/* ASCII 码表工具专用样式 */

/* ==================== 工具栏样式 ==================== */
.ascii-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
}

.toolbar-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.toolbar-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: #334155;
}

.toolbar-search {
    flex: 1;
}

.toolbar-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.toolbar-actions .btn {
    white-space: nowrap;
}

.toolbar-item label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-item label i {
    color: #2563eb;
}

.toolbar-item > span {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-item > span i {
    color: #2563eb;
}

/* 搜索框样式 */
.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrapper input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    display: none;
}

.clear-search:hover {
    color: #475569;
}

/* 筛选器样式 */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e3a8a;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.chip.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

/* 切换开关样式 */
.toggle-group {
    flex-direction: row;
    gap: 20px;
    justify-content: flex-start;
}

.toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: #334155;
}

.toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ==================== 表格区域样式 ==================== */
.ascii-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
    color: #1e293b;
}

.section-header p {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.table-wrapper {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.7);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.ascii-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.ascii-table th,
.ascii-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 14px;
    vertical-align: middle;
}

.ascii-table thead {
    background: rgba(30, 64, 175, 0.08);
}

.ascii-table th {
    font-weight: 600;
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
}

.ascii-table tbody tr {
    transition: background 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.ascii-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.7);
}

.ascii-table tbody tr:hover {
    background: rgba(219, 234, 254, 0.55);
    transform: translateX(2px);
}

/* 数值徽章样式 */
.value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 13px;
}

/* 符号显示样式 */
.symbol-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.symbol-display {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px dashed rgba(96, 165, 250, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(191, 219, 254, 0.35);
    color: #0f172a;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont;
}

.symbol-display[data-hint="true"]::after {
    content: attr(data-label);
    font-size: 11px;
    color: #1d4ed8;
    display: block;
}

.symbol-label {
    font-size: 12px;
    color: #475569;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* HTML 实体样式 */
.html-entity {
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    color: #0f766e;
    background: rgba(13, 148, 136, 0.08);
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.html-entity button {
    border: none;
    background: transparent;
    color: #0f766e;
    cursor: pointer;
    font-size: 12px;
}

.html-entity button:hover {
    color: #0d9488;
}

/* 描述文本样式 */
.description-text {
    color: #1f2937;
    line-height: 1.5;
}

.description-text span {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    color: #64748b;
    background: rgba(148, 163, 184, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
}

/* 行状态样式 */
.row-muted {
    opacity: 0.45;
}

.row-hidden {
    display: none;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .toolbar-row {
        flex-direction: column;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .ascii-toolbar {
        padding: 16px;
        gap: 16px;
    }

    .toolbar-row {
        gap: 16px;
    }

    .toolbar-actions {
        flex-direction: column;
    }

    .toggle-group {
        flex-direction: column;
        gap: 12px;
    }

    .symbol-display {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .filter-chips {
        gap: 6px;
    }

    .chip {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    .ascii-toolbar,
    .table-wrapper {
        background: rgba(15, 23, 42, 0.55);
        border-color: rgba(148, 163, 184, 0.3);
        box-shadow: none;
    }

    .ascii-table tbody tr:nth-child(even) {
        background: rgba(30, 41, 59, 0.6);
    }

    .ascii-table tbody tr:hover {
        background: rgba(59, 130, 246, 0.18);
    }

    .search-wrapper input {
        background: rgba(15, 23, 42, 0.4);
        border-color: rgba(148, 163, 184, 0.3);
        color: #e2e8f0;
    }

    .chip {
        background: rgba(30, 41, 59, 0.6);
        border-color: rgba(148, 163, 184, 0.3);
        color: #94a3b8;
    }
}
