* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    background: #f5f5f5;
    color: #333;
}

/* 强制所有元素使用系统字体（包含中文字体） */
* {
    font-family: Inter, 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif !important;
}

.container {
    display: flex;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.generator-panel {
    flex: 0 0 400px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    overflow-y: auto;
    max-height: 100vh;
}

.generator-panel h1 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #1677ff;
    text-align: center;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #e8e8e8;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: #1677ff;
    border-bottom-color: #1677ff;
}

.tab-content {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1677ff;
}

.form-group button {
    margin-top: 8px;
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.form-group button:hover {
    background: #e6f7ff;
    border-color: #1677ff;
    color: #1677ff;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-inputs select {
    flex: 1;
}

.time-inputs span {
    font-size: 18px;
    font-weight: bold;
}

.battery-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -5px;
}

.battery-control button {
    width: 30px;
    height: 30px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.battery-control button:hover {
    background: #f5f5f5;
}

.battery-bar {
    flex: 1;
    height: 20px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.battery-fill {
    height: 100%;
    background: #52c41a;
    width: 70%;
    transition: width 0.3s;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    background: #1677ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.generate-btn:hover {
    background: #4096ff;
}

.preview-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.phone-frame {
    /* 固定尺寸，保持iPhone 13 Pro Max比例 */
    width: 400px;
    height: 866px;
    background: white;
    border-radius: 0;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    object-fit: contain;
}

/* 预设：通过给 .phone-frame 添加类来一键切换 */
/* 标准样式：地址适度加重、字距为0 */
.weight-target { font-weight: 500 !important; letter-spacing: 0 !important; }

/* 移除断点，完全连续自适应 */

/* 确保图片完全显示 */
.background-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.transaction-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.editable-text {
    outline: none;
    font-family: 'SF Pro Display', 'SF Pro Text', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0 !important; /* 标准字距 */
    /* 固定字体大小，不随窗口变化 */
    font-size: 14px;
}

/* 确保所有input元素都使用系统字体（包含中文字体） */
input[type="text"] {
    font-family: Inter, 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 控制区（左侧表单）地址/哈希字间距收紧，和预览一致 */
#sender-account,
#receiver-account,
#transaction-hash,
#tp-transaction-hash,
#tp-sender-account,
#tp-receiver-account,
#im-sender-account,
#im-receiver-account {
    letter-spacing: -0.6px !important;
}

/* 特别针对状态栏时间 */
#display-status-time {
    font-family: Inter, 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 600 !important;
}

/* 地址统一加粗（金额不动） */
#display-bochang-sender-address,
#display-bochang-receiver-address,
#display-tp-sender-address,
#display-tp-receiver-address {
    font-weight: 420 !important;
    letter-spacing: -0.8px !important; /* 再收紧字间距 */
}

/* IM地址字体较细 */
#display-im-sender-address,
#display-im-sender-address-2,
#display-im-sender-address-3,
#display-im-receiver-address,
#display-im-receiver-address-2 {
    font-weight: 300 !important;
    letter-spacing: -0.8px !important; /* 再收紧字间距 */
}

/* IM 底部两行地址有内联 letter-spacing:0.5px，这里强制收紧覆盖 */
#display-im-sender-address-3-line1,
#display-im-sender-address-3-line2 {
    letter-spacing: -0.8px !important;
    font-weight: 300 !important;
}

#display-im-time {
    letter-spacing: 0.6px !important;
}

#display-bochang-time,
#display-tp-time {
    letter-spacing: -0.6px !important;
}
.editable-text:focus {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid #1890ff !important;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: white;
    font-size: 14px;
    font-weight: 600;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.signal {
    width: 20px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 10h2v2H2v-2zm4-2h2v4H6V8zm4-2h2v6h-2V6zm4-2h2v8h-2V4z' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.wifi {
    width: 16px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M8 0C3.6 0 0 3.6 0 8c0 1.1.9 2 2 2s2-.9 2-2c0-2.2 1.8-4 4-4s4 1.8 4 4c0 1.1.9 2 2 2s2-.9 2-2c0-4.4-3.6-8-8-8z' fill='%23000'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.battery {
    width: 24px;
    height: 12px;
    border: 1px solid #000;
    border-radius: 2px;
    position: relative;
}

.battery::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3px;
    width: 2px;
    height: 6px;
    background: #000;
    border-radius: 0 1px 1px 0;
}

.battery::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 70%;
    height: 6px;
    background: #52c41a;
    border-radius: 1px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #1677ff;
    cursor: pointer;
}

.share-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #1677ff;
    cursor: pointer;
}

.app-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.transaction-card {
    background: white;
    margin: 20px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.transaction-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.status-section {
    display: flex;
    align-items: center;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #52c41a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.status-text {
    font-size: 14px;
    color: #52c41a;
    font-weight: 500;
}

.transaction-type {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.transaction-amount {
    font-size: 32px;
    font-weight: normal;
    color: #ff4d4f;
    margin-bottom: 20px;
}

.transaction-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-row .label {
    min-width: 80px;
    color: #666;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;
}

.detail-row .value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.account-number {
    color: #1677ff;
    font-size: 14px;
    font-weight: 500;
    margin-right: 4px;
}

.info-icon {
    color: #1677ff;
    font-size: 14px;
    font-weight: bold;
    margin-right: 4px;
}

.account-label {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-right: 4px;
}

.book-icon {
    font-size: 16px;
    margin-left: 8px;
}

.address {
    color: #333;
    font-size: 14px;
    font-family: monospace;
    word-break: break-all;
    flex-shrink: 0;
}

.copy-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #f5f5f5;
}

.qr-section {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.qr-code {
    position: relative;
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
}

.qr-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

.qr-text {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #333;
    font-size: 12px;
}

.bottom-section {
    position: absolute;
    bottom: 60px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.tronscan-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    width: 16px;
    height: 16px;
    background: #ff4d4f;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.tronscan-logo span {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.view-details {
    color: #1677ff;
    font-size: 12px;
    cursor: pointer;
}

.home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: #000;
    border-radius: 3px;
}


/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }
    
    .preview-panel {
        order: -1;
    }
    
    .phone-frame {
        /* 保持固定尺寸，不随屏幕变化 */
        width: 400px;
        height: 866px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .generator-panel {
        padding: 20px;
    }
    
    .phone-frame {
        /* 保持固定尺寸，不随屏幕变化 */
        width: 400px;
        height: 866px;
    }
}