@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

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

[v-cloak] { display: none !important; }

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #1a1a2e;
    --bg-sidebar-hover: #16213e;
    --bg-sidebar-active: #0f3460;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --text-sidebar: #e0e0e0;
    --border: #e0e0e0;
    --border-color: #e0e0e0;
    --accent: #2a2a2a;
    --accent-light: #404040;
    --primary: #4a6cf7;
    --primary-bg: #eef2ff;
    --success: #28a745;
    --success-bg: #e8f5e9;
    --danger: #dc3545;
    --danger-bg: #ffebee;
    --info: #17a2b8;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
    --sidebar-width: 220px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 3px;
    color: #fff;
}

.sidebar-header p {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
    letter-spacing: 1px;
}

.nav-section {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-section-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-sidebar);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-section-title:hover {
    background: var(--bg-sidebar-hover);
}

.nav-section-title.active {
    background: var(--bg-sidebar-active);
    border-left-color: var(--primary);
    color: #fff;
}

.nav-section-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-primary);
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Form */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
input[type="text"],
input[type="number"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    box-sizing: border-box;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* Result Box */
.result-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    word-break: break-all;
    min-height: 50px;
    position: relative;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.copy-btn:hover { opacity: 1; }

/* Checkbox */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.checkbox-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* Info Text */
.info-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Stat Item */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-primary);
    font-size: 14px;
}

.stat-item:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-family: 'JetBrains Mono', monospace; font-weight: 500; }

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th, table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bg-primary);
}

table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:hover td { background: var(--bg-primary); }

.ascii-table { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Color */
.color-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    transition: var(--transition);
}

.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 6px;
    margin-top: 16px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

/* QR */
.qr-preview {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-preview img, .qr-preview canvas {
    max-width: 256px;
    margin: 0 auto;
}

#qr-container { display: inline-block; }
#qr-container img { display: block; margin: 0 auto; }

/* Image Compress */
.img-compress-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.img-compress-preview .preview-box { text-align: center; }

.img-compress-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.img-compress-preview .size-info {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-primary);
}

.upload-area:hover {
    border-color: var(--accent);
    background: #fff;
}

.upload-area .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: #ffebee; color: var(--danger); }
.badge-info { background: var(--primary-bg); color: var(--primary); }

/* CRC */
.crc-protocol-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.crc-protocol-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.crc-protocol-btn:hover { border-color: var(--accent); }

.crc-protocol-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* 2FA */
.totp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.totp-item .issuer { font-weight: 600; font-size: 14px; }
.totp-item .account { font-size: 12px; color: var(--text-muted); }
.totp-item .code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 4px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    transition: width 1s linear;
}

/* Diff */
.diff-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 3px 10px;
    border-left: 3px solid transparent;
}

.diff-line.added { background: #e8f5e9; border-left-color: var(--success); }
.diff-line.removed { background: #ffebee; border-left-color: var(--danger); }

/* Timer */
.timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px;
    text-align: center;
    padding: 30px;
    font-weight: 600;
}

/* Time */
.time-display {
    text-align: center;
    padding: 30px;
}

.time-display .time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px;
    font-weight: 600;
}

.time-display .date {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 8px;
}

.time-display .utc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* RSA Key Display */
.rsa-key-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow-y: auto;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--bg-sidebar);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 60px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .img-compress-preview {
        grid-template-columns: 1fr;
    }
}

/* 古籍阅读样式 */
.classical-result {
    background: linear-gradient(135deg, #faf6ef 0%, #f5efe4 100%);
    border: 1px solid #d4c5a9;
    position: relative;
}

.classical-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b7355, #c4a77d, #8b7355);
}

.classical-content {
    font-family: 'Noto Serif SC', 'Source Han Serif CN', 'Songti SC', 'SimSun', serif;
    line-height: 2;
    color: #3d3225;
    padding: 20px;
}

.classical-content h1,
.classical-content h2,
.classical-content h3 {
    font-family: 'Noto Serif SC', 'Source Han Serif CN', 'STKaiti', 'KaiTi', serif;
    color: #5a4632;
    margin: 1.5em 0 0.8em 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #c4a77d;
    letter-spacing: 2px;
}

.classical-content h1 {
    font-size: 1.6em;
    text-align: center;
    border-bottom: none;
    background: linear-gradient(180deg, transparent 60%, rgba(196, 167, 125, 0.2) 60%);
    display: inline-block;
    padding: 0 20px;
}

.classical-content h2 {
    font-size: 1.3em;
    padding-left: 12px;
    border-left: 4px solid #8b7355;
    border-bottom: none;
}

.classical-content h3 {
    font-size: 1.1em;
    color: #7a6548;
}

.classical-content p {
    margin: 0.8em 0;
    text-indent: 2em;
    text-align: justify;
}

.classical-content strong {
    color: #6b4c2a;
    font-weight: 600;
    background: linear-gradient(180deg, transparent 60%, rgba(196, 167, 125, 0.15) 60%);
}

.classical-content em {
    font-style: normal;
    color: #8b6914;
    border-bottom: 1px dashed #c4a77d;
}

.classical-content blockquote {
    margin: 1em 0;
    padding: 12px 20px;
    background: rgba(139, 115, 85, 0.06);
    border-left: 4px solid #8b7355;
    border-radius: 0 4px 4px 0;
    font-size: 0.95em;
    color: #5a4632;
}

.classical-content blockquote p {
    text-indent: 0;
    margin: 0.3em 0;
}

.classical-content code {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    background: rgba(139, 115, 85, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #6b4c2a;
}

.classical-content pre {
    background: #2d2416;
    color: #e8d5b7;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.classical-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.classical-content ul,
.classical-content ol {
    margin: 0.8em 0;
    padding-left: 2em;
}

.classical-content li {
    margin: 0.4em 0;
    text-indent: 0;
}

.classical-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.classical-content th {
    background: rgba(139, 115, 85, 0.15);
    color: #5a4632;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #d4c5a9;
    text-align: left;
}

.classical-content td {
    padding: 8px 12px;
    border: 1px solid #d4c5a9;
}

.classical-content tr:nth-child(even) {
    background: rgba(139, 115, 85, 0.03);
}

.classical-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4a77d, transparent);
    margin: 1.5em 0;
}

/* 古籍输入区域样式 */
.classical-input textarea {
    font-family: 'Noto Serif SC', 'Source Han Serif CN', 'STFangsong', 'FangSong', serif;
    line-height: 1.8;
    letter-spacing: 1px;
}

/* 添加古籍字体支持 */

/* 元素周期表经典样式 */
.periodic-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.periodic-table-main {
    display: grid;
    grid-template-columns: repeat(18, minmax(52px, 1fr));
    grid-template-rows: repeat(7, minmax(52px, auto));
    gap: 3px;
    margin-bottom: 16px;
}

.periodic-table-lanthanides,
.periodic-table-actinides {
    display: grid;
    grid-template-columns: repeat(15, minmax(52px, 1fr));
    gap: 3px;
    margin-top: 8px;
    position: relative;
    padding-left: 36px;
}

.series-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    writing-mode: vertical-lr;
    letter-spacing: 2px;
}

.element-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 52px;
    position: relative;
}

.element-cell:hover {
    transform: scale(1.12);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.element-cell.element-selected {
    transform: scale(1.15);
    z-index: 11;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.element-number {
    font-size: 8px;
    color: var(--text-muted);
    line-height: 1;
}

.element-symbol {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.element-name {
    font-size: 9px;
    color: var(--text-secondary);
    line-height: 1;
}

.periodic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-text {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .periodic-table-main {
        grid-template-columns: repeat(18, minmax(42px, 1fr));
    }
    .periodic-table-lanthanides,
    .periodic-table-actinides {
        grid-template-columns: repeat(15, minmax(42px, 1fr));
    }
    .element-symbol {
        font-size: 14px;
    }
    .element-name {
        font-size: 8px;
    }
}

/* 新增功能样式 */

/* Grid-5 布局 */
.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* 代码块 */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* 统计框 */
.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-box .stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.stat-box .stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 日历网格 */
.calendar-grid {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary);
    color: white;
}

.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    padding: 8px;
    min-height: 60px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day.today {
    background: var(--primary-bg);
    border-color: var(--primary);
}

.calendar-day.weekend .solar {
    color: var(--danger);
}

.calendar-day .solar {
    font-weight: 600;
    font-size: 14px;
}

.calendar-day .lunar {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.calendar-day .festival-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}


/* 5列网格响应式 */
@media (max-width: 768px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-day {
        min-height: 50px;
        padding: 4px;
    }

    .calendar-day .solar {
        font-size: 12px;
    }

    .calendar-day .lunar {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .grid-5 {
        grid-template-columns: 1fr;
    }
}

/* Search sidebar button */
.sidebar-search {
    margin: 0 12px 12px;
    padding: 8px 12px;
    background: var(--bg-sidebar-hover);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.sidebar-search:hover {
    background: var(--bg-sidebar-active);
    border-color: rgba(255,255,255,0.2);
}
.sidebar-search .search-icon {
    font-size: 14px;
    opacity: 0.6;
}
.sidebar-search .search-placeholder {
    flex: 1;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.sidebar-search .search-shortcut {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* Search overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
}
.search-modal {
    width: 560px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.search-modal-icon {
    font-size: 18px;
    opacity: 0.5;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
}
.search-close {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}
.search-results {
    overflow-y: auto;
    padding: 8px;
}
.search-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}
.search-hint {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.search-result-item:hover {
    background: var(--primary-bg);
}
.search-result-cat {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.search-result-name {
    font-size: 14px;
    font-weight: 500;
}

/* Error box */
.error-box {
    padding: 12px 16px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius);
    font-size: 13px;
}


/* JWT Tab styling */
.jwt-tab-active {
    background: var(--primary) !important;
    color: #fff !important;
}

/* Disabled button */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Calendar jian star */
.jian-star {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1;
    margin-top: 1px;
}

/* HTTP status codes */
.status-success { color: var(--success); }
.status-redirect { color: var(--info); }
.status-client-error { color: #f39c12; }
.status-server-error { color: var(--danger); }

/* Markdown preview */
.md-preview-content h1 { font-size: 24px; font-weight: 700; margin: 16px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.md-preview-content h2 { font-size: 20px; font-weight: 600; margin: 14px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-preview-content h3 { font-size: 17px; font-weight: 600; margin: 12px 0 8px; }
.md-preview-content h4 { font-size: 15px; font-weight: 600; margin: 10px 0 6px; }
.md-preview-content p { margin: 8px 0; }
.md-preview-content ul, .md-preview-content ol { padding-left: 24px; margin: 8px 0; }
.md-preview-content li { margin: 4px 0; }
.md-preview-content blockquote { border-left: 4px solid var(--primary); padding: 8px 16px; margin: 12px 0; background: var(--bg-primary); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-secondary); }
.md-preview-content code { font-family: 'JetBrains Mono', monospace; background: var(--bg-primary); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--danger); }
.md-preview-content pre { background: #1e1e2e; color: #cdd6f4; padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; }
.md-preview-content pre code { background: none; color: inherit; padding: 0; }
.md-preview-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.md-preview-content th, .md-preview-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md-preview-content th { background: var(--bg-primary); font-weight: 600; }
.md-preview-content hr { border: none; border-top: 2px solid var(--border); margin: 20px 0; }
.md-preview-content img { max-width: 100%; border-radius: var(--radius); }
.md-preview-content a { color: var(--primary); text-decoration: underline; }
.md-preview-content strong { font-weight: 600; }
.md-preview-content em { font-style: italic; }

/* Copy Toast */
.copy-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 8px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ==================== 分类视图和工具卡片 ==================== */

/* 分类头部 */
.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.category-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 28px;
}

.category-count {
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 12px;
}

/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.back-btn span {
    font-size: 16px;
}

/* 工具卡片网格 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* 工具卡片 */
.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    background: var(--primary-bg);
}

.tool-card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.tool-card:hover .tool-card-icon {
    background: var(--bg-secondary);
}

.tool-card-info {
    flex: 1;
    min-width: 0;
}

.tool-card-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tool-card-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 工具详情视图 */
.tool-view {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 工具头部导航 */
.tool-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 14px;
}

.current-tool {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 欢迎视图 */
.welcome-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.welcome-content {
    text-align: center;
    padding: 40px;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.welcome-content > p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.welcome-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.welcome-stats .stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* 工具数量徽章 */
.tool-count {
    margin-left: auto;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
}

/* 思维链折叠样式 */
details summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '▶';
    font-size: 10px;
    transition: transform 0.2s;
}

details[open] summary::before {
    transform: rotate(90deg);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .category-header {
        flex-wrap: wrap;
    }

    .welcome-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 36px;
    }
}
