/* ---- jwt.html 私有样式：双编辑器类页面 ---- */
.container {
    max-width: 1400px;
}

.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.panel {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 620px;
    position: relative;
}

.panel-header {
    border-bottom: none;
    order: 1;
    flex-shrink: 0;
}

.panel-header:first-child {
    border-top: 1px solid #e5e7eb;
}

/* ---- 工具栏 ---- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-group:not(:last-of-type) {
    padding-right: 15px;
    border-right: 1px solid #e5e7eb;
}

.toolbar-hint {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}

/* ---- 模式切换 ---- */
.mode-bar {
    order: 2;
    flex-shrink: 0;
    padding: 10px 15px 0 15px;
}

.mode-bar .radio-group {
    display: flex;
    gap: 10px;
}

.mode-bar .radio-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    background: #fff;
}

.mode-bar .radio-card:has(input:checked) {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
}

.mode-bar .radio-card input {
    accent-color: #667eea;
    margin: 0;
}

.mode-bar .radio-card .btn {
    display: none;
    margin-left: auto;
    padding: 4px 14px;
    font-size: 12px;
    line-height: 1.6;
}

.mode-bar .radio-card:has(input:checked) .btn {
    display: inline-flex;
    align-items: center;
}

/* ---- 编辑区 ---- */
.editor-area {
    order: 3;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.hidden-area {
    display: none !important;
}

.form-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 10px;
}

textarea.form-control {
    height: auto;
    min-height: 180px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
}

.token-input {
    min-height: 150px;
    word-break: break-all;
}

.json-input {
    min-height: 130px;
    font-size: 13px;
}

.key-input {
    min-height: 90px;
    font-size: 12px;
    margin-top: 8px;
}

/* ---- 快捷声明 chips ---- */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.claim-chip {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.claim-chip:hover {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
}

.chip-del:hover {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

/* ---- 结果区 ---- */
.seg-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}

.seg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    margin-left: 8px;
}

.seg-dot:first-child {
    margin-left: 0;
}

.seg-header { background: #667eea; }
.seg-payload { background: #16a34a; }
.seg-signature { background: #ef4444; }

.badge {
    display: none;
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
}

.badge-ok {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
}

.badge-bad {
    display: inline-block;
    background: #fef2f2;
    color: #dc2626;
}

.badge-none {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
}

.result-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 6px;
}

#expireHint {
    font-weight: 400;
    color: #dc2626;
    margin-left: 6px;
    font-size: 12px;
}

.code-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
    max-height: 220px;
    margin: 0;
}

.token-out {
    max-height: 300px;
    user-select: all;
}

/* ---- JSON 高亮（与 json-formatter 一致） ---- */
.json-key { color: #881391; }
.json-string { color: #0b7500; }
.json-number { color: #1750eb; }
.json-boolean { color: #ff6d01; }
.json-null { color: #999; }

/* ---- 时间声明表 ---- */
.time-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.time-table th,
.time-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}

.time-table th {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
}

.time-table td {
    color: #4b5563;
    font-variant-numeric: tabular-nums;
}

.time-table td:first-child {
    font-family: 'Consolas', monospace;
    color: #4338ca;
    font-weight: 600;
}

.time-table tbody tr:hover {
    background: #fafbff;
}

/* ---- 简介区 ---- */
.info-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.8;
    color: #6b7280;
}

.info-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* ---- 状态条 ---- */
.status-bar {
    order: 4;
    flex-shrink: 0;
}

/* ---- 小屏适配 ---- */
@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .panel {
        height: auto;
        min-height: 360px;
    }
    .editor-area {
        overflow: visible;
    }

    textarea.form-control,
    .token-input,
    .json-input {
        min-height: 180px;
    }

    .toolbar-hint {
        margin-left: 0;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .code-block {
        max-height: none;
    }
}
