:root {
    /* 莫兰迪色系 / Morandi Colors */
    --m-blue: #708BB3;
    --m-blue-dim: #5A7091;
    --m-pink: #D4A8A4;
    --m-green: #9FB3A2;
    --m-gray: #8E8E93;
    
    /* 浅色模式材质 (Light Mode Materials) */
    --bg-base: #F2F2F7;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --accent: #007AFF;
    
    /* Glass Materials */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-blur: blur(20px) saturate(180%);
    
    /* Blobs Colors */
    --blob-1: #D4E3FC;
    --blob-2: #E8D6D5;
    --blob-3: #D8E6DA;

    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
    
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 深色模式适配 */
[data-theme="dark"] {
    --bg-base: #000000;
    --text-primary: #F5F5F7;
    --text-secondary: #98989D;
    --accent: #0A84FF;
    
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    
    --blob-1: #1C2533;
    --blob-2: #332222;
    --blob-3: #1A2620;
}

/* 系统深色模式 (当未手动设置 data-theme 时生效) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-base: #000000;
        --text-primary: #F5F5F7;
        --text-secondary: #98989D;
        --accent: #0A84FF;
        
        --glass-bg: rgba(30, 30, 30, 0.6);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        --glass-highlight: rgba(255, 255, 255, 0.05);
        
        --blob-1: #1C2533;
        --blob-2: #332222;
        --blob-3: #1A2620;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    transition: color var(--transition), background-color var(--transition);
    overflow-x: hidden;
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.8;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 { top: -10%; left: -10%; width: 60vw; height: 60vw; background: var(--blob-1); }
.blob-2 { bottom: -10%; right: -10%; width: 70vw; height: 70vw; background: var(--blob-2); animation-delay: -5s; }
.blob-3 { top: 40%; left: 40%; width: 50vw; height: 50vw; background: var(--blob-3); animation-delay: -10s; opacity: 0.5; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glass Components */
.glass-panel, .glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Header Redesign (Grid Layout for Perfect Centering) */
header.glass-panel {
    position: sticky;
    top: 20px;
    z-index: 100;
    border-radius: 99px;
    padding: 8px 12px;
    margin-bottom: 32px;
    width: 100%;
    /* Glass effect handled by .glass-panel */
}

.header-content {
    display: grid;
    grid-template-columns: 44px 1fr 44px; /* Fixed width for buttons, flexible center */
    align-items: center;
    width: 100%;
    height: 44px;
}

h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0 8px;
}

/* Icon Buttons (Header & Global) */
.icon-btn {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(120, 120, 128, 0.1);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.icon-btn:hover { background: rgba(120, 120, 128, 0.2); transform: scale(1.05); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 22px; height: 22px; stroke-width: 2px; }

/* Hidden elements */
.hidden { display: none !important; }

/* Main Content */
main { flex: 1; display: flex; flex-direction: column; gap: 24px; }

.view-section { width: 100%; }

/* Layout Split (Detail View) */
.layout-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .layout-split { grid-template-columns: 4fr 6fr; align-items: start; }
}

/* Image Card */
.glass-card { border-radius: var(--radius-l); padding: 24px; transition: var(--transition); }

.image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
    position: relative;
    background: rgba(255,255,255,0.02);
}
.image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-m);
    transition: transform 0.5s ease;
}
.image-wrapper:hover img { transform: scale(1.02); }

/* Info List */
.info-list { display: flex; flex-direction: column; gap: 0; }

.info-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(120, 120, 128, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-item:first-child { padding-top: 0; }

.info-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
}
.info-value {
    font-size: 16px;
    color: var(--text-primary);
    word-break: break-word;
}

/* Typography Styles */
.scale-1 { font-size: 14px; }
.scale-2 { font-size: 16px; }
.scale-3 { font-size: 18px; font-weight: 500; }
.scale-4 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.scale-5 { font-size: 28px; font-weight: 800; }
.style-2 { font-weight: 600; }
.style-3 { font-style: italic; }
.style-4 { font-weight: 600; font-style: italic; }

/* Links */
.info-value a {
    color: var(--m-blue);
    text-decoration: none;
    border-bottom: 1px solid var(--m-blue);
    transition: all 0.2s ease;
}
.info-value a:hover { color: var(--m-pink); border-bottom-color: var(--m-pink); }

/* Description Table Style */
.desc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    font-size: 14px;
    background: rgba(120, 120, 128, 0.03);
    border-radius: var(--radius-s);
    overflow: hidden;
}
.desc-table tr:nth-child(odd) { background: rgba(120, 120, 128, 0.02); }
.desc-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 600;
    width: 35%;
    vertical-align: top;
    border-bottom: 1px solid rgba(120, 120, 128, 0.05);
}
.desc-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    vertical-align: top;
    border-bottom: 1px solid rgba(120, 120, 128, 0.05);
}
.desc-table tr:last-child th, .desc-table tr:last-child td { border-bottom: none; }

/* Inputs & Buttons */
.glass-input {
    width: 100%;
    background: rgba(120, 120, 128, 0.08);
    border: 1px solid transparent;
    border-radius: var(--radius-m);
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}
.glass-input:focus {
    background: rgba(120, 120, 128, 0.12);
    border-color: var(--accent);
}

.glass-btn {
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-m);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 8px;
}

.glass-btn.primary {
    background: var(--text-primary);
    color: var(--bg-base);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.glass-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }
.glass-btn.primary:active { transform: scale(0.98); }

.glass-btn.secondary {
    background: rgba(120, 120, 128, 0.1);
    color: var(--text-primary);
}
.glass-btn.secondary:hover { background: rgba(120, 120, 128, 0.15); }

.glass-btn.ghost { background: transparent; color: var(--text-secondary); }
.glass-btn.ghost:hover { color: var(--text-primary); background: rgba(120, 120, 128, 0.05); }

.glass-btn.small { font-size: 13px; padding: 6px 12px; }

/* Search View */
.search-form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.card-header { margin-bottom: 16px; }
.card-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.subtitle { font-size: 14px; color: var(--text-secondary); }
.card-header.small { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-header.small h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); }

.badge {
    background: rgba(120, 120, 128, 0.1);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Landing Page Grid */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.info-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    text-decoration: none;
}
.info-card:hover {
    background: var(--glass-highlight);
    transform: scale(1.02);
}
.info-card h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; }
.info-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; text-align: left; }
.card-icon { width: 24px; height: 24px; color: var(--m-blue); }

/* IP Info Grid (New Fix) */
.ip-info-grid {
    display: grid;
    grid-template-columns: 45px 1fr;
    column-gap: 8px;
    row-gap: 4px;
    width: 100%;
    font-size: 14px;
    margin-top: 4px;
}
.ip-label {
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}
.ip-value {
    color: var(--text-primary);
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
}

/* Recent Item Highlight */
.recent-highlight {
    border: 1px solid var(--m-green);
    background: rgba(159, 179, 162, 0.1);
}

/* Result List */
.result-list { display: flex; flex-direction: column; gap: 8px; }
.result-item {
    display: block;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-s);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}
[data-theme="dark"] .result-item { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.05); }
.result-item:hover { background: rgba(255, 255, 255, 0.7); transform: scale(1.01); }
[data-theme="dark"] .result-item:hover { background: rgba(255, 255, 255, 0.1); }
.res-title { font-size: 16px; font-weight: 600; color: var(--text-primary); display: block; }
.res-id { font-size: 12px; font-family: monospace; color: var(--text-secondary); display: block; margin-top: 2px; }
.empty-state { text-align: center; padding: 40px; color: var(--text-secondary); font-style: italic; }

/* Status Badges */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 99px;
    font-size: 13px; font-weight: 500;
    background: rgba(120, 120, 128, 0.08);
    border: 1px solid rgba(120, 120, 128, 0.1);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: #34C759; box-shadow: 0 0 8px rgba(52, 199, 89, 0.4); }
.dot.yellow { background: #FFCC00; box-shadow: 0 0 8px rgba(255, 204, 0, 0.4); }
.dot.red { background: #FF3B30; box-shadow: 0 0 8px rgba(255, 59, 48, 0.4); }
.dot.gray { background: #8E8E93; }
.dot.blue { background: #007AFF; }

/* Copy ID */
.copyable { cursor: pointer; position: relative; display: inline-block; transition: opacity 0.2s; }
.copyable:hover { opacity: 0.7; }
.copyable::after {
    content: "复制"; font-size: 10px; position: absolute; right: -30px; top: 50%; transform: translateY(-50%);
    background: var(--text-primary); color: var(--bg-base); padding: 2px 4px; border-radius: 4px; opacity: 0; transition: opacity 0.2s;
}
.copyable:hover::after { opacity: 1; }
.copyable.copied::after { content: "已复制"; background: #34C759; opacity: 1; }

/* Footer */
footer { text-align: center; margin-top: 40px; opacity: 0.6; font-size: 12px; }

/* Turnstile */
.turnstile-box { margin-top: 16px; display: flex; justify-content: center; }
.contact-revealed { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Error Pages */
.error-card {
    max-width: 420px; width: 90%; padding: 48px 32px;
    display: flex; flex-direction: column; align-items: center; gap: 24px;
    text-align: center; margin: 40px auto;
}
.error-code {
    font-size: 80px; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em; margin-bottom: -10px; opacity: 0.8;
}
.error-icon-box {
    width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(120, 120, 128, 0.05); color: var(--m-pink); margin-bottom: 8px;
}
.error-icon-box svg { width: 40px; height: 40px; opacity: 0.8; }
.error-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.error-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; max-width: 300px; }
.error-desc code { font-family: monospace; background: rgba(120, 120, 128, 0.1); padding: 2px 6px; border-radius: 4px; color: var(--text-primary); }
.btn-stack { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* Test Page Specific */
.debug-card { overflow: hidden; display: flex; flex-direction: column; min-height: 400px; }
.title-group { display: flex; align-items: center; gap: 12px; }
.tab-group { display: flex; background: rgba(120, 120, 128, 0.1); padding: 4px; border-radius: 12px; }
.tab-group .glass-btn { padding: 6px 16px; font-size: 13px; border-radius: 8px; }
.tab-group .glass-btn.active { background: var(--text-primary); color: var(--bg-base); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.content-view.hidden { display: none; }
.table-wrapper { width: 100%; overflow-x: auto; border-radius: var(--radius-s); border: 1px solid rgba(120, 120, 128, 0.1); }
.glass-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.glass-table th { text-align: left; padding: 12px 16px; background: rgba(120, 120, 128, 0.05); color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid rgba(120, 120, 128, 0.1); }
.glass-table td { padding: 12px 16px; border-bottom: 1px solid rgba(120, 120, 128, 0.05); color: var(--text-primary); vertical-align: top; }
.glass-table tr:last-child td { border-bottom: none; }
.glass-table tr:hover td { background: rgba(120, 120, 128, 0.03); }
.cell-bold { font-weight: 600; }
.cell-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(120, 120, 128, 0.1); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--accent); }
.cell-tag { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: rgba(120, 120, 128, 0.1); color: var(--text-secondary); }
.cell-details { display: flex; flex-wrap: wrap; gap: 4px; }
.kv-tag { font-size: 11px; background: rgba(255, 255, 255, 0.3); border: 1px solid rgba(120, 120, 128, 0.15); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
[data-theme="dark"] .kv-tag { background: rgba(255, 255, 255, 0.05); }
.code-block { margin: 0; padding: 16px; background: rgba(0, 0, 0, 0.03); border-radius: var(--radius-s); overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; color: var(--text-primary); border: 1px solid rgba(120, 120, 128, 0.1); }
[data-theme="dark"] .code-block { background: rgba(0, 0, 0, 0.2); }
.actions-row { margin-top: 24px; display: flex; justify-content: center; }