/* ============================================================
   BioRender 会员升级 —— 全局样式
   风格对齐 biodraw.io：蓝色渐变头部 + 圆角卡片
   ============================================================ */
:root {
    --primary-blue: #2563eb;
    --light-blue: #dbeafe;
    --dark-blue: #1d4ed8;
    --light-gray: #f8fafc;
    --border-gray: #e2e8f0;
    --text-gray: #64748b;
    --text-dark: #0f172a;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--light-gray) 0%, #e2e8f0 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

/* ---------- 激活卡片 ---------- */
.activation-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--border-gray);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.card-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .025em;
}

.card-header p {
    margin: .6rem 0 0;
    font-size: .9rem;
    opacity: .85;
}

.card-body {
    padding: 2.5rem 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-label {
    display: block;
    color: var(--text-gray);
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .5rem;
}

.activation-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    font-size: 1.15rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .18em;
    text-transform: uppercase;
    transition: all .2s ease;
    background: white;
}

.activation-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.activation-input:disabled {
    background: #f1f5f9;
    color: var(--text-gray);
    cursor: not-allowed;
}

.submit-button {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, .4);
}

.submit-button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.loading-text {
    display: none;
    text-align: center;
    color: var(--text-gray);
    font-size: .9rem;
    margin-top: 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    display: none;
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: var(--danger);
    font-size: .875rem;
    line-height: 1.5;
    white-space: pre-line;
}

/* ---------- 历史记录下拉 ---------- */
.history-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--border-gray);
    border-radius: 10px;
    box-shadow: 0 10px 20px -6px rgba(0, 0, 0, .15);
    z-index: 20;
    overflow: hidden;
}

.history-dropdown.show {
    display: block;
}

.history-item {
    padding: .65rem 1rem;
    font-family: ui-monospace, Menlo, monospace;
    font-size: .9rem;
    cursor: pointer;
}

.history-item:hover {
    background: var(--light-blue);
}

/* ---------- 主页 ---------- */
.main-page {
    width: 100%;
    max-width: 820px;
    padding: 1.5rem;
}

.main-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border-gray);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-gray);
    background: var(--light-gray);
}

.tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text-gray);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all .15s ease;
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: var(--primary-blue);
    background: #fff;
    border-bottom-color: var(--primary-blue);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 .5rem;
}

.section-desc {
    color: var(--text-gray);
    font-size: .9rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.steps-list {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0 0 1.5rem;
}

.steps-list li {
    counter-increment: step;
    position: relative;
    padding: .6rem 0 .6rem 2.4rem;
    font-size: .9rem;
    color: #334155;
    line-height: 1.6;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .55rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--light-blue);
    color: var(--dark-blue);
    font-weight: 700;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-gray);
    margin-bottom: .45rem;
}

.field input[type=text],
.field input[type=email] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 2px solid var(--border-gray);
    border-radius: 10px;
    font-size: .95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.radio-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.radio-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    cursor: pointer;
}

.notice {
    display: none;
    margin-top: 1rem;
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .875rem;
    line-height: 1.5;
    white-space: pre-line;
}

.notice.success {
    display: block;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--success);
}

.notice.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    vertical-align: middle;
}

.badge.ok { background: #d1fae5; color: #065f46; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }

.link-button {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: .875rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 14px;
    max-width: 420px;
    width: 100%;
    padding: 1.75rem;
    box-shadow: 0 24px 40px -12px rgba(0, 0, 0, .3);
}

.modal h3 {
    margin: 0 0 .75rem;
    font-size: 1.1rem;
}

.modal h3.error { color: var(--danger); }

.modal p {
    margin: 0 0 1.5rem;
    color: var(--text-gray);
    font-size: .9rem;
    line-height: 1.6;
    white-space: pre-line;
}

.modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
}

.btn {
    padding: .55rem 1.2rem;
    border-radius: 9px;
    border: 1px solid var(--border-gray);
    background: #fff;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

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

@media (max-width: 520px) {
    .card-header, .card-body, .tab-content { padding-left: 1.25rem; padding-right: 1.25rem; }
}
