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

:root {
    --primary: #5B7FFF;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #EF4444;
    --dark: #1F2937;
    --gray: #6B7280;
    --light-gray: #F3F4F6;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #F0F4FF 0%, #FFFFFF 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* 模态框 */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.warning-text {
    background: #FEF2F2;
    border-left: 3px solid var(--danger);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--dark);
}

.notice-section h3 {
    color: var(--dark);
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
}

.notice-list {
    list-style: none;
}

.notice-list li {
    padding: 0.6rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--dark);
}

.modal-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #4A6FEE;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* 头部 */
.header {
    text-align: center;
    padding: 2rem 0 1.5rem;
    animation: fadeIn 0.5s ease;
}

.header h1 {
    font-size: 1.6rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

/* 公告 */
.announcement {
    background: white;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.announcement-header h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.announcement-content > p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray);
    margin-bottom: 1rem;
}

.warning-notice {
    background: #FEF2F2;
    border-left: 4px solid var(--danger);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
}

.warning-notice p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--dark);
    margin: 0;
}

.notice-tips {
    margin-bottom: 1rem;
}

.notice-tips p {
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.notice-tips p:last-child {
    margin-bottom: 0;
}

.tip-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tip-card {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--primary);
}

.tip-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.tip-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--gray);
    margin: 0 0 0.75rem 0;
}

.purchase-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.purchase-btn:hover {
    background: #4A6FEE;
    transform: translateX(3px);
}

.purchase-btn:active {
    transform: translateX(0);
}

.help-link {
    text-align: center;
    padding-top: 0.5rem;
}

.help-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.help-link a:hover {
    color: #4A6FEE;
    gap: 0.5rem;
}

/* 账号区域 */
.accounts-section {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.subtitle-small {
    color: var(--gray);
    font-size: 0.85rem;
}

.accounts-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.account-card {
    background: var(--light-gray);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.account-title {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 600;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.inactive {
    background: #FEE2E2;
    color: #991B1B;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.info-label {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.info-value {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
}

.info-value span {
    flex: 1;
    min-width: 0;
}

.password-text {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: 2px;
}

.toggle-btn {
    background: var(--light-gray);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.toggle-btn:hover {
    background: #E5E7EB;
}

.toggle-btn:active {
    transform: scale(0.95);
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #4A6FEE;
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: var(--success);
}

.refresh-btns {
    text-align: center;
    padding-top: 0.5rem;
}

.btn-refresh {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
}

.btn-refresh:hover {
    background: #4A6FEE;
}

.btn-refresh:active {
    transform: scale(0.98);
}

/* 使用说明 */
.instructions {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.instructions h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-number {
    background: var(--primary);
    color: white;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
    padding-top: 0.15rem;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--gray);
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.disclaimer {
    font-size: 0.8rem;
}

.tip {
    color: var(--primary);
    font-weight: 500;
}

.notice {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 500;
    margin-top: 0.5rem;
}

/* 响应式优化 */
@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }
    
    .header {
        padding: 2.5rem 0 2rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .modal-content {
        max-width: 540px;
    }
    
    .accounts-section,
    .announcement,
    .instructions {
        padding: 1.5rem;
    }
    
    .account-card {
        padding: 1.25rem;
    }
}

/* 移动端优化 */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.4rem;
    }
    
    .info-value {
        font-size: 0.8rem;
        padding: 0.65rem;
    }
    
    .copy-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* iOS Safari 优化 */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark);
}

/* 选中文本样式 */
::selection {
    background: var(--primary);
    color: white;
}

/* 加载动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

.loading-message,
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.loading-message {
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.error-message p {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
