/* =============================================
   Web Archive - 圆角科技简约风格
   高圆角、毛玻璃、卡片化、深色科技感
   ============================================= */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #a78bfa;
    --bg: #0b0b14;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.07);
    --bg-glass: rgba(255,255,255,0.03);
    --text: #e8e8f0;
    --text-secondary: #9898b8;
    --text-muted: #6b6b8a;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(99,102,241,0.3);
    --success: #22c55e;
    --error: #ef4444;
    --warn: #f59e0b;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow: 0 8px 40px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 40px rgba(99,102,241,0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: all 0.25s ease; }
a:hover { color: var(--accent); }

::selection { background: var(--primary); color: #fff; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header {
    background: rgba(11,11,20,0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo:hover { color: var(--primary-light) !important; }
.logo-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.site-header nav { display: flex; gap: 4px; }
.site-header nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.site-header nav a:hover {
    background: var(--bg-card);
    color: var(--text);
}

/* ===== Hero ===== */
.hero {
    padding: 80px 0 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    background: linear-gradient(135deg, #e8e8f0 0%, var(--primary-light) 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    position: relative;
}
.hero-desc {
    color: var(--text-muted);
    font-size: 17px;
    margin-bottom: 36px;
    position: relative;
}

/* ===== Forms ===== */
.save-form { margin-bottom: 28px; }
.input-group {
    display: flex;
    gap: 0;
    max-width: 680px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--bg-glass);
}
.input-group:focus-within {
    border-color: var(--border-hover);
    box-shadow: var(--shadow), var(--shadow-glow);
}
.input-group input {
    flex: 1;
    padding: 18px 22px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    outline: none;
    font-family: var(--font);
}
.input-group input::placeholder { color: var(--text-muted); }
.input-group button {
    padding: 18px 30px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    font-family: var(--font);
    letter-spacing: 0.3px;
}
.btn-save {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.btn-save:hover { filter: brightness(1.12); transform: scale(1.02); }
.btn-query {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border-left: 1px solid var(--border);
}
.btn-query:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.form-options {
    max-width: 680px;
    margin: 14px auto 0;
    text-align: left;
    padding-left: 4px;
}
.checkbox-label {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.checkbox-label:hover { border-color: var(--border-hover); }
.checkbox-label input {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    border-radius: 4px;
}

/* Query Section */
.query-section {
    max-width: 680px;
    margin: 32px auto 0;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.query-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-align: left;
}
.query-form .input-group {
    border-radius: 14px;
}
.query-form .input-group input {
    padding: 15px 20px;
    font-size: 15px;
}

/* ===== Stats Bar ===== */
.stats-bar {
    padding: 32px 0 28px;
}
.stats-grid {
    display: flex;
    justify-content: center;
    gap: 48px;
}
.stat {
    text-align: center;
    padding: 16px 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-width: 140px;
    transition: all 0.3s;
}
.stat:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.stat-num {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ===== Main Grid ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    padding: 8px 24px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== Section Headers ===== */
section h2, aside h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 4px;
    color: var(--text);
    letter-spacing: -0.2px;
}

/* ===== Archive List ===== */
.archive-list {
    display: grid;
    gap: 6px;
}
.archive-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
    align-items: center;
}
.archive-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(6px);
    box-shadow: var(--shadow-glow);
}
.archive-title {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.archive-url {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    grid-column: 1;
}
.archive-meta {
    grid-row: span 2;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.archive-meta time {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.archive-meta .size {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Hot Section ===== */
.hot-list { display: grid; gap: 6px; }
.hot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.hot-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}
.hot-domain {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hot-count {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 8px;
    padding: 2px 10px;
    background: rgba(99,102,241,0.1);
    border-radius: 20px;
}

/* ===== Browse Page ===== */
.browse-page { padding: 32px 0; }
.page-info {
    margin-bottom: 24px;
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.page-info h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.page-url {
    word-break: break-all;
    margin-bottom: 14px;
}
.page-url a { color: var(--primary-light); font-size: 14px; }
.page-stats {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-muted);
}
.page-stats strong { color: var(--text); }

.re-save { margin-bottom: 28px; }
.re-save .btn-save {
    padding: 12px 28px;
    border-radius: 14px;
    font-size: 14px;
}

/* ===== Timeline ===== */
.timeline-month { margin-bottom: 24px; }
.timeline-month h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.timeline-items { display: grid; gap: 5px; }
.timeline-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.timeline-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.timeline-item.failed { opacity: 0.4; }
.timeline-time {
    min-width: 85px;
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.timeline-status { font-size: 16px; min-width: 24px; }
.timeline-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}
.timeline-arrow { color: var(--primary-light); }

/* ===== Timeline Chart ===== */
.timeline-chart {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.timeline-chart h3 { margin-bottom: 18px; font-size: 15px; }
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 80px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.chart-bar {
    flex-shrink: 0;
    width: 10px;
    background: linear-gradient(to top, var(--primary), var(--accent));
    border-radius: 5px 5px 2px 2px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    min-height: 3px;
}
.chart-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.05);
    transform-origin: bottom;
}
.chart-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1c1c30;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    color: var(--text);
    box-shadow: var(--shadow);
}
.chart-bar:hover .chart-tooltip { display: block; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}
.empty-state .btn { margin-top: 18px; }

/* ===== Install Page ===== */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.install-card {
    max-width: 560px;
    width: 100%;
    padding: 44px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.install-card h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
.install-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}
.install-card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 14px;
}
.install-card hr {
    border: none;
    border-top: 1px solid var(--border);
    margin-bottom: 28px;
}

.check-list { list-style: none; margin-bottom: 22px; }
.check-list li {
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.check-list li.pass {
    background: rgba(34,197,94,0.08);
    border-left: 3px solid var(--success);
}
.check-list li.fail {
    background: rgba(239,68,68,0.08);
    border-left: 3px solid var(--error);
}
.check-list li.warn {
    background: rgba(245,158,11,0.08);
    border-left: 3px solid var(--warn);
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}
.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}
.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    color: #86efac;
}

.stats-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 24px 0;
}
.install-card .btn {
    display: block;
    text-align: center;
    margin: 18px auto;
    max-width: 260px;
}
.install-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-family: var(--font);
    letter-spacing: 0.2px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.btn-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.3);
    color: #fff;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.site-footer p {
    font-size: 13px;
    color: var(--text-muted);
}
.site-footer .footer-icp {
    font-size: 12px;
    color: var(--text-muted);
}
.site-footer .footer-icp a {
    color: var(--text-muted);
}
.site-footer .footer-icp a:hover {
    color: var(--primary-light);
}
.footer-note {
    font-size: 12px;
    color: #3a3a54;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero { padding: 48px 0 32px; }
    .hero h1 { font-size: 28px; }
    .hero-desc { font-size: 15px; }
    .main-grid {
        grid-template-columns: 1fr;
        padding: 8px 16px 32px;
    }
    .stats-grid {
        gap: 12px;
        flex-wrap: wrap;
    }
    .stat {
        min-width: 100px;
        padding: 14px 20px;
    }
    .input-group {
        flex-direction: column;
        border-radius: var(--radius);
    }
    .input-group input {
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 16px 18px;
    }
    .input-group button {
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 14px;
    }
    .page-stats { flex-direction: column; gap: 4px; }
    .archive-item { grid-template-columns: 1fr; gap: 2px; }
    .archive-meta {
        grid-row: auto;
        text-align: left;
        flex-direction: row;
        gap: 14px;
        margin-top: 4px;
    }
    .site-header nav a { padding: 6px 10px; font-size: 13px; }
}

/* ===== 点击验证码（柚鸟安全验证） ===== */
.captcha-area {
    max-width: 680px;
    margin: 16px auto 0;
}
.captcha-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px 12px;
}

.captcha-image {
    text-align: center;
    margin-bottom: 12px;
    min-height: 50px;
}
.captcha-image .captcha-img {
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
}
.captcha-image .captcha-img:hover { opacity: 0.85; }

.captcha-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.captcha-input-wrap input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}
.captcha-input-wrap input[type="text"]:focus {
    border-color: var(--primary);
}
.captcha-input-wrap input[type="text"]::placeholder {
    font-size: 13px;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--text-muted);
}

.captcha-brand {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.5px;
    opacity: 0.5;
}

.btn-captcha-trigger {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font);
}
.btn-captcha-trigger:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    color: var(--text);
}

.btn-captcha-refresh {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-captcha-refresh:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .captcha-body { padding: 14px 14px 10px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero, .stats-bar, .main-grid {
    animation: fadeInUp 0.6s ease both;
}
.stats-bar { animation-delay: 0.1s; }
.main-grid { animation-delay: 0.2s; }

/* ===== Loading / Toast ===== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 22px;
    border-radius: 14px;
    z-index: 99999;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
    backdrop-filter: blur(10px);
}
.toast-success { background: rgba(34,197,94,0.9); color: #fff; }
.toast-error { background: rgba(239,68,68,0.9); color: #fff; }
.toast-info { background: rgba(99,102,241,0.9); color: #fff; }

@keyframes toastIn {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
