/*
 文件名称：dev-toolbox.css
 作者：wangkai（2026-11-24）
 创作时间：2026-11-24 22:50:00（北京时间）
 文件说明：开发小工具包样式，包含标签页、表单、文本域、结果列表、代码块与移动端适配
*/

/* 页面容器 */
.dt-page {
    max-width: 1290px;
    margin: 24px auto 40px;
    padding: 0 12px;
}

/* 主面板 */
.dt-card {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(31, 45, 61, 0.06);
    padding: 24px;
}

.dt-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: #1f2d3d;
}

.dt-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: #7a869a;
    line-height: 1.6;
}

/* 标签页 */
.dt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #e5e9f2;
    margin-bottom: 20px;
}

.dt-tab {
    position: relative;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    font-size: 14px;
    color: #5a6678;
    cursor: pointer;
    transition: color 0.2s;
}

.dt-tab:hover {
    color: #2563eb;
}

.dt-tab.is-active {
    color: #2563eb;
    font-weight: 600;
}

.dt-tab.is-active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: #2563eb;
}

/* 面板显隐 */
.dt-panel {
    display: none;
}

.dt-panel.is-active {
    display: block;
}

/* 表单 */
.dt-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dt-field label {
    font-size: 13px;
    color: #5a6678;
}

.dt-input {
    width: 100%;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #1f2d3d;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dt-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

select.dt-input {
    cursor: pointer;
}

/* 文本域 */
.dt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2d3d;
    outline: none;
    resize: vertical;
    word-break: break-all;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dt-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dt-textarea[readonly] {
    background: #fbfcfe;
}

.dt-textarea--mono,
.dt-code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 两列文本域布局 */
.dt-io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 选项组 */
.dt-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 38px;
    align-items: center;
    font-size: 13px;
    color: #1f2d3d;
}

.dt-checks label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* 操作区 */
.dt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.dt-btn {
    padding: 9px 18px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #1f2d3d;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

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

.dt-btn--primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.dt-btn--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.dt-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.dt-btn--sm {
    padding: 5px 12px;
    font-size: 13px;
}

.dt-tip {
    font-size: 13px;
    color: #7a869a;
}

.dt-tip.is-ok {
    color: #16a34a;
}

.dt-tip.is-error {
    color: #dc2626;
}

/* UUID 结果列表 */
.dt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.dt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.dt-item:hover {
    border-color: #2563eb;
    background: #f5f9ff;
}

.dt-item__index {
    flex: 0 0 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: #eef4ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
}

.dt-item__text {
    flex: 1 1 auto;
    min-width: 0;
    font-family: "SFMono-Regular", Consolas, Monaco, monospace;
    font-size: 14px;
    color: #1f2d3d;
    word-break: break-all;
}

.dt-item__copy {
    flex: 0 0 auto;
    font-size: 12px;
    color: #2563eb;
}

/* JWT 结果块 */
.dt-jwt-block {
    margin-top: 16px;
}

.dt-jwt-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.dt-jwt-block__title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2d3d;
}

.dt-code {
    margin: 0;
    padding: 12px;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 13px;
    line-height: 1.6;
    color: #1f2d3d;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow: auto;
}

.dt-jwt-meta {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 13px;
    line-height: 1.8;
    color: #5a6678;
}

.dt-jwt-meta strong {
    color: #1f2d3d;
    font-weight: 600;
}

.dt-jwt-meta .is-expired {
    color: #dc2626;
}

.dt-jwt-meta .is-valid {
    color: #16a34a;
}

/* 通用隐藏 */
.dt-hidden {
    display: none !important;
}

/* 移动端适配 */
@media (max-width: 720px) {
    .dt-card {
        padding: 16px;
    }

    .dt-io {
        grid-template-columns: 1fr;
    }
}
