/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* ========== 语言切换 ========== */
.language-selector {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 15px;
}

.lang-btn {
    padding: 6px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
}

/* ========== 头部 ========== */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #2563eb;
}

.header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ========== 主要内容 ========== */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #475569;
    font-size: 0.9rem;
}

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* ========== 账户列表 ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.account-count {
    color: #64748b;
    font-size: 0.9rem;
}

.accounts-list {
    display: grid;
    gap: 15px;
}

.account-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.account-info h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.account-info p {
    color: #64748b;
    font-size: 0.85rem;
}

.account-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    padding: 6px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #f1f5f9;
    border-color: #2563eb;
}

.totp-code {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: #2563eb;
    letter-spacing: 0.15em;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

.progress-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.1s linear;
    border-radius: 3px;
}

.progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.countdown {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.copy-btn {
    width: 100%;
    margin-top: 10px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #475569;
    margin-bottom: 8px;
}

.empty-state p {
    color: #94a3b8;
}

/* ========== 数据管理 ========== */
.management-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.management-buttons > * {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 44px;
}

/* 确保 label 按钮与 button 一致 */
.management-buttons label {
    margin: 0;
    line-height: normal;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-footer .btn {
    flex: 1;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.85rem;
}

.footer p {
    margin: 5px 0;
}

.version {
    opacity: 0.8;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 20px;
    }

    .totp-code {
        font-size: 1.5rem;
    }

    .management-buttons {
        grid-template-columns: 1fr;
    }

    .account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-card {
    animation: fadeIn 0.3s ease-out;
}

/* ========== 实用类 ========== */
.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}

.text-muted {
    color: #94a3b8;
}

