:root {
            --bg: #ffffff;
            --text: #1f2329;
            --text-secondary: #646a73;
            --text-muted: #8a9099;
            --border: #e5e6eb;
            --border-light: #f2f3f5;
            --input-bg: #fafbfc;
            --card-bg: #ffffff;
            --hover-bg: #f7f8fa;
            --primary: #2563eb;
            --primary-hover: #1d4ed8;
            --success: #34c724;
            --danger: #f53f3f;
            --danger-hover: #d93030;
            --section-divider: #e5e6eb;
        }
        body.dark {
            --bg: #1a1a1a;
            --text: #e0e0e0;
            --text-secondary: #a0a0a0;
            --text-muted: #707070;
            --border: #333333;
            --border-light: #2a2a2a;
            --input-bg: #242424;
            --card-bg: #222222;
            --hover-bg: #2a2a2a;
            --primary: #4a7cf7;
            --primary-hover: #3a6ce0;
            --success: #4ade80;
            --danger: #f87171;
            --danger-hover: #ef4444;
            --section-divider: #333333;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
            background: var(--bg);
            color: var(--text);
            transition: background 0.25s, color 0.25s;
            min-height: 100vh;
        }

        .top-header {
            position: fixed;
            top: 0; left: 0; right: 0;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
            z-index: 100;
        }
        .header-inner {
            max-width: 960px;
            margin: 0 auto;
            padding: 0 24px;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .header-left { display: flex; align-items: center; gap: 24px; min-width: 0; }
        .brand { font-size: 18px; font-weight: 600; white-space: nowrap; }
        .nav-tabs { display: flex; gap: 20px; overflow-x: auto; }
        .nav-tab {
            font-size: 15px;
            color: var(--text-muted);
            cursor: pointer;
            padding: 16px 0;
            border-bottom: 2px solid transparent;
            transition: color 0.2s, border-color 0.2s;
            white-space: nowrap;
            background: none;
            border-top: none; border-left: none; border-right: none;
            font-family: inherit;
        }
        .nav-tab:hover { color: var(--text); }
        .nav-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
        .header-right { display: flex; align-items: center; gap: 12px; }
        .domain-badge {
            font-size: 13px;
            color: var(--text-secondary);
            background: var(--hover-bg);
            padding: 4px 12px;
            border-radius: 20px;
            white-space: nowrap;
        }
        .domain-badge a { color: var(--primary); text-decoration: none; }
        .domain-badge a:hover { text-decoration: underline; }
        .btn-logout {
            padding: 6px 14px;
            font-size: 13px;
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            font-family: inherit;
        }
        .btn-logout:hover { background: var(--hover-bg); color: var(--text); }

        .main-content {
            max-width: 960px;
            margin: 0 auto;
            padding: 88px 24px 60px;
        }

        #login-area {
            max-width: 360px;
            margin: 80px auto 0;
            padding: 0 20px;
            animation: fadeIn 0.3s ease;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        #login-area h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
        #login-area .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
        .field { margin-bottom: 14px; }
        .field label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }
        .field input, .field textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            background: var(--input-bg);
            color: var(--text);
            transition: 0.2s;
            font-family: inherit;
        }
        .field input:focus, .field textarea:focus {
            border-color: var(--primary);
            background: var(--bg);
            outline: none;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        .login-error { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 20px; }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: 0.15s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            white-space: nowrap;
            font-family: inherit;
        }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-primary { background: var(--text); color: var(--bg); }
        .btn-primary:hover:not(:disabled) { opacity: 0.85; }
        .btn-full { width: 100%; }
        .btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
        .btn-outline:hover:not(:disabled) { background: var(--hover-bg); }
        .btn-sm { padding: 5px 12px; font-size: 13px; }
        .btn-danger { background: var(--danger); color: white; }
        .btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
        .btn-success { background: var(--primary); color: white; }
        .btn-success:hover:not(:disabled) { background: var(--primary-hover); }

        #view-manage, #view-tokens, #view-settings, #view-reports, #view-ratelimits {
            display: none;
            animation: fadeIn 0.3s ease;
        }
        #view-manage.active, #view-tokens.active, #view-settings.active, #view-reports.active, #view-ratelimits.active { display: block; }

        .status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            margin-bottom: 20px;
            border-bottom: 1px solid var(--border-light);
            flex-wrap: wrap;
            gap: 8px;
        }
        .status-bar .count { font-size: 14px; color: var(--text-secondary); }
        .status-bar .count strong { color: var(--text); font-weight: 600; }
        .status-right { display: flex; align-items: center; gap: 12px; }
        .status-text { font-size: 13px; color: var(--text-muted); }
        .cooldown-badge {
            background: var(--text);
            color: var(--bg);
            padding: 3px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            display: none;
            animation: fadeIn 0.2s ease;
        }
        .cooldown-badge.active { display: inline-block; }

        .toolbar {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .create-btn-group {
            position: relative;
            display: inline-flex;
        }
        .create-btn-main {
            padding: 10px 20px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 6px 0 0 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: background 0.15s, opacity 0.15s;
            font-family: inherit;
            white-space: nowrap;
        }
        .create-btn-main:hover:not(:disabled) { background: var(--primary-hover); }
        .create-btn-main:disabled { opacity: 0.5; cursor: not-allowed; }
        .create-btn-arrow {
            padding: 10px 12px;
            background: var(--primary);
            color: white;
            border: none;
            border-left: 1px solid rgba(255,255,255,0.25);
            border-radius: 0 6px 6px 0;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.15s, opacity 0.15s;
            font-family: inherit;
        }
        .create-btn-arrow:hover:not(:disabled) { background: var(--primary-hover); }
        .create-btn-arrow:disabled { opacity: 0.5; cursor: not-allowed; }
        .create-btn-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
            padding: 4px;
            min-width: 180px;
            z-index: 50;
            display: none;
        }
        .create-btn-dropdown.open { display: block; animation: dropdownIn 0.15s ease; }
        @keyframes dropdownIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .dropdown-option {
            padding: 8px 12px;
            font-size: 14px;
            border-radius: 5px;
            cursor: pointer;
            color: var(--text);
            transition: background 0.1s;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .dropdown-option:hover { background: var(--hover-bg); }

        .multi-toolbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            display: none;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 14px 24px;
            background: var(--card-bg);
            border-top: 1px solid var(--border);
            box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
            z-index: 90;
            animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .multi-toolbar.active { display: flex; }
        @keyframes slideUp {
            from { transform: translateY(100%); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .multi-toolbar .count { font-size: 14px; color: var(--text); }
        .multi-toolbar .spacer { flex: 1; max-width: 400px; }

        .main-content.multi-active { padding-bottom: 100px; }

        .list-header {
            display: grid;
            grid-template-columns: 1fr 1fr 140px;
            gap: 16px;
            padding: 8px 0;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
            margin-bottom: 4px;
        }
        .list-header.multi {
            grid-template-columns: 40px 1fr 1fr;
        }
        .link-item {
            display: grid;
            grid-template-columns: 1fr 1fr 140px;
            gap: 16px;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid var(--border-light);
            font-size: 14px;
            animation: fadeIn 0.25s ease;
        }
        .link-item.multi {
            grid-template-columns: 40px 1fr 1fr;
        }
        .link-item:last-child { border-bottom: none; }
        .link-item.expired { opacity: 0.55; }
        .link-item.expired .short-url a { color: var(--text-muted); }
        .expired-tag {
            display: inline-block;
            font-size: 11px;
            color: var(--danger);
            background: rgba(245, 63, 63, 0.1);
            padding: 1px 6px;
            border-radius: 3px;
            margin-left: 6px;
            vertical-align: middle;
        }
        .user-tag {
            display: inline-block;
            font-size: 11px;
            color: var(--primary);
            background: rgba(37, 99, 235, 0.08);
            padding: 1px 6px;
            border-radius: 3px;
            margin-left: 6px;
            vertical-align: middle;
        }
        .link-item .checkbox-cell {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .link-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }
        .link-item .short-url { font-weight: 500; word-break: break-all; }
        .link-item .short-url a { color: var(--primary); text-decoration: none; }
        .link-item .short-url a:hover { text-decoration: underline; }
        .link-item .target-url {
            color: var(--text-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .link-item .target-url a { color: var(--text-secondary); text-decoration: none; }
        .link-item .target-url a:hover { color: var(--primary); text-decoration: underline; }
        .link-item .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }
        .link-item .actions .btn { padding: 4px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
        .empty { text-align: center; color: var(--text-muted); padding: 60px 0; font-size: 14px; }

        /* Token 列表 */
        .token-item {
            display: grid;
            grid-template-columns: 1fr 1fr 140px;
            gap: 16px;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid var(--border-light);
            font-size: 14px;
            animation: fadeIn 0.25s ease;
        }
        .token-item.multi {
            grid-template-columns: 40px 1fr 1fr 140px;
        }
        .token-item:last-child { border-bottom: none; }
        .token-item .token-value {
            font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
            font-size: 12px;
            color: var(--text-secondary);
            word-break: break-all;
        }
        .token-item .short-code {
            font-weight: 500;
            color: var(--primary);
            word-break: break-all;
        }
        .token-item .actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }
        .token-item .actions .btn {
            padding: 4px 12px;
            font-size: 12px;
            white-space: nowrap;
        }
        .token-item .checkbox-cell {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .token-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }
        #token-list-header.multi {
            grid-template-columns: 40px 1fr 1fr;
        }

        .settings-section {
            margin-bottom: 8px;
            border-bottom: 1px solid var(--section-divider);
            padding-bottom: 24px;
        }
        .settings-section:last-child { border-bottom: none; margin-bottom: 0; }
        .settings-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
        .settings-section .section-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
        .setting-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 0;
            gap: 16px;
        }
        .setting-label { flex: 1; min-width: 0; }
        .setting-label .name { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
        .setting-label .desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
        .setting-control { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

        .theme-dropdown { position: relative; width: 140px; }
        .theme-trigger {
            width: 100%;
            padding: 8px 12px;
            font-size: 14px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--input-bg);
            color: var(--text);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-family: inherit;
        }
        .theme-trigger:hover { border-color: var(--primary); }
        .theme-dropdown.open .theme-trigger { border-color: var(--primary); }
        .theme-trigger .caret { color: var(--text-muted); font-size: 11px; transition: transform 0.2s; }
        .theme-dropdown.open .caret { transform: rotate(180deg); }
        .theme-menu {
            position: absolute;
            top: calc(100% + 4px); left: 0; right: 0;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,.1);
            padding: 4px;
            z-index: 10;
            display: none;
        }
        .theme-dropdown.open .theme-menu { display: block; animation: dropdownIn 0.15s ease; }
        .theme-option {
            padding: 8px 12px;
            font-size: 14px;
            border-radius: 5px;
            cursor: pointer;
            color: var(--text);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .theme-option:hover { background: var(--hover-bg); }
        .theme-option.selected { color: var(--primary); font-weight: 500; }
        .theme-option.selected::after {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            font-size: 12px;
        }

        .modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(2px);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
        .modal-box {
            background: var(--card-bg);
            border-radius: 12px;
            padding: 28px 32px;
            max-width: 520px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
            animation: modalScaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            max-height: 90vh;
            overflow-y: auto;
        }
        @keyframes modalScaleIn {
            from { opacity: 0; transform: scale(0.94); }
            to { opacity: 1; transform: scale(1); }
        }
        .modal-box h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
        .modal-box .modal-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }
        .modal-box .field { margin-bottom: 16px; }
        .modal-box .field label {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            display: block;
            margin-bottom: 4px;
        }
        .modal-box .field input, .modal-box .field select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            background: var(--input-bg);
            color: var(--text);
            font-family: inherit;
        }
        .modal-box .field input:focus, .modal-box .field select:focus {
            border-color: var(--primary);
            background: var(--bg);
            outline: none;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        .modal-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 12px;
            flex-wrap: wrap;
        }
        .modal-actions .btn { min-width: 80px; }

        .staged-list { margin-bottom: 16px; max-height: 160px; overflow-y: auto; }
        .staged-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            background: var(--hover-bg);
            border-radius: 6px;
            margin-bottom: 6px;
            font-size: 13px;
            gap: 8px;
        }
        .staged-item .code { font-weight: 500; color: var(--primary); }
        .staged-item .url {
            color: var(--text-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 1;
        }
        .staged-item .remove {
            color: var(--danger);
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            flex-shrink: 0;
        }
        .staged-item .remove:hover { background: rgba(245, 63, 63, 0.1); }

        .toast-container {
            position: fixed;
            top: 72px;
            right: 24px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 2000;
            max-width: 360px;
            width: 100%;
        }
        .toast {
            padding: 12px 18px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            color: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 10px;
            transition: opacity 0.3s, transform 0.3s;
        }
        .toast.success { background: #22c55e; }
        .toast.error { background: #dc2626; }
        .toast.info { background: #2563eb; }
        @keyframes toastIn {
            from { opacity: 0; transform: translateX(20px); }
            to { opacity: 1; transform: translateX(0); }
        }

        /* 举报列表 */
        .report-item {
            display: grid;
            grid-template-columns: 1.2fr 1fr 1fr 100px;
            gap: 16px;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid var(--border-light);
            font-size: 14px;
            animation: fadeIn 0.25s ease;
        }
        .report-item.multi {
            grid-template-columns: 40px 1.2fr 1fr 1fr;
        }
        .report-item:last-child { border-bottom: none; }
        .report-item .report-code {
            font-weight: 500;
            color: var(--primary);
            word-break: break-all;
        }
        .report-item .report-reason {
            color: var(--danger);
            word-break: break-all;
        }
        .report-item .report-time {
            color: var(--text-muted);
            font-size: 13px;
            white-space: nowrap;
        }
        .report-item .actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }
        .report-item .actions .btn {
            padding: 4px 12px;
            font-size: 12px;
            white-space: nowrap;
        }
        .report-item .checkbox-cell {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .report-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }
        #report-list-header.multi {
            grid-template-columns: 40px 1.2fr 1fr 1fr;
        }

        /* 举报详情 */
        .detail-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 8px 24px;
        }
        .detail-row {
            display: flex;
            padding: 16px 0;
            border-bottom: 1px solid var(--border-light);
            gap: 20px;
        }
        .detail-row:last-child { border-bottom: none; }
        .detail-row .detail-label {
            width: 100px;
            flex-shrink: 0;
            font-size: 14px;
            color: var(--text-muted);
        }
        .detail-row .detail-value {
            flex: 1;
            font-size: 14px;
            color: var(--text);
            word-break: break-all;
            line-height: 1.6;
        }
        .detail-row .detail-value a {
            color: var(--primary);
            text-decoration: none;
        }
        .detail-row .detail-value a:hover { text-decoration: underline; }

        /* 限流列表 */
        .ratelimit-item {
            display: grid;
            grid-template-columns: 1.5fr 1fr 1.5fr 60px;
            gap: 16px;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid var(--border-light);
            font-size: 14px;
        }
        .ratelimit-item:last-child { border-bottom: none; }
        .ratelimit-item .ratelimit-ip {
            font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
            font-size: 13px;
            color: var(--text);
            word-break: break-all;
        }
        .ratelimit-item .ratelimit-count {
            color: var(--primary);
            font-weight: 500;
        }
        .ratelimit-item .ratelimit-time {
            color: var(--text-muted);
            font-size: 13px;
            white-space: nowrap;
        }

        @media (max-width: 640px) {
            .header-inner { padding: 0 16px; }
            .header-left { gap: 16px; }
            .brand { font-size: 16px; }
            .nav-tabs { gap: 14px; }
            .nav-tab { font-size: 14px; }
            .domain-badge { display: none; }
            .main-content { padding: 80px 16px 40px; }
            .list-header { display: none; }
            .link-item, .token-item {
                grid-template-columns: 1fr;
                gap: 6px;
                padding: 12px 0;
            }
            .link-item.multi, .token-item.multi { grid-template-columns: 40px 1fr; }
            .link-item .actions, .token-item .actions { justify-content: flex-start; margin-top: 4px; }
            .setting-row { flex-direction: column; align-items: flex-start; gap: 12px; }
            .setting-control { width: 100%; justify-content: flex-end; }
            .modal-box { padding: 20px; }
            .toast-container { top: 64px; right: 12px; left: 12px; max-width: none; }
            .multi-toolbar { padding: 12px 16px; }
            .report-item, .ratelimit-item {
                grid-template-columns: 1fr;
                gap: 6px;
                padding: 12px 0;
            }
            .report-item.multi { grid-template-columns: 40px 1fr; }
            .report-item .actions { justify-content: flex-start; margin-top: 4px; }
            .detail-row { flex-direction: column; gap: 4px; }
            .detail-row .detail-label { width: auto; }
        }