/* ====================================================
   日期时间格式化工具 - datetime_formatter.css
   ==================================================== */

/* ========== 隐藏工具类 ========== */
.dt-hidden { display: none !important; }

/* ========== 主容器 ========== */
.dt-container {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    background: #f0f2f8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.12), 0 1px 4px rgba(0,0,0,0.06);
    margin: 0 0 16px 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* ========== 顶部工具栏 ========== */
.dt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 45%, #764ba2 100%);
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.35);
}

/* Tab 按鈕组 */
.toolbar-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.12);
    padding: 3px;
    border-radius: 24px;
}

.tab-btn {
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.18);
    color: white;
}

.tab-btn.active {
    background: white;
    color: #5a67d8;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 操作按鈕组 */
.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-btn {
    padding: 5px 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 5px;
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.28);
    color: white;
    transform: translateY(-1px);
}

/* 实时时钟 */
.dt-live-clock {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: rgba(0,0,0,0.2);
    padding: 5px 14px;
    border-radius: 6px;
    letter-spacing: 2px;
    min-width: 96px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ========== Tab 面板 ========== */
.tab-pane {
    display: none;
    flex: 1;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* ========== 两栏布局 ========== */
.dt-two-panel {
    display: flex;
    flex: 1;
    min-height: 540px;
}

/* ========== 左侧输入面板 ========== */
.dt-input-panel {
    width: 340px;
    min-width: 270px;
    background: white;
    border-right: 1px solid #e8edf5;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* ========== 右侧结果面板 ========== */
.dt-result-panel {
    flex: 1;
    background: #f8faff;
    padding: 18px 20px;
    overflow-y: auto;
    min-width: 0;
}

/* ========== 左导色条区域标题 ========== */
.section-title {
    font-size: 12px;
    font-weight: 700;
    color: #5a67d8;
    padding: 8px 0 8px 10px;
    border-left: 3px solid #667eea;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    background: linear-gradient(to right, rgba(102,126,234,0.06), transparent);
    border-radius: 0 4px 4px 0;
}

/* ========== 结果面板标题行（含复制全部按鈕） ========== */
.result-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8edf5;
    margin-bottom: 14px;
}

.copy-all-btn {
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.copy-all-btn:hover {
    background: #e0e7ff;
    border-color: #667eea;
    color: #5a67d8;
    box-shadow: 0 1px 4px rgba(102,126,234,0.2);
}

/* ========== 表单组 ========== */
.form-group {
    margin-bottom: 13px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
}

.form-group label em {
    font-style: normal;
    color: #94a3b8;
    font-weight: 400;
    font-size: 11px;
}

/* 文本输入框 */
.dt-text-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fafbff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.dt-text-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.dt-text-input::placeholder {
    color: #b0bac9;
    font-size: 12px;
}

/* 下拉选择 */
.dt-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fafbff;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.dt-select:focus { border-color: #667eea; }

.dt-select-sm {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 12px;
    color: #374151;
    background: #fafbff;
    outline: none;
    cursor: pointer;
}

/* 数字输入 */
.dt-num-input {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    outline: none;
    text-align: center;
    box-sizing: border-box;
    background: #fafbff;
}

.dt-num-input:focus { border-color: #667eea; }

/* ========== 格式识别提示 ========== */
.format-hint {
    padding: 5px 10px;
    background: linear-gradient(to right, #f0f9ff, #f8faff);
    border: 1px solid #bae6fd;
    border-left: 3px solid #38bdf8;
    border-radius: 4px;
    font-size: 11px;
    color: #0369a1;
    margin-top: 5px;
    line-height: 1.4;
    font-weight: 500;
}

.format-hint.error {
    background: linear-gradient(to right, #fff7ed, #fffbf5);
    border-color: #fed7aa;
    border-left-color: #f97316;
    color: #c2410c;
}

/* ========== 快速示例 Chips ========== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 11px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    user-select: none;
}

.chip:hover {
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    border-color: #667eea;
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102,126,234,0.18);
}

/* ========== 单选组 ========== */
.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 6px 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    font-weight: 400;
}

.radio-item input[type="radio"] {
    cursor: pointer;
    accent-color: #667eea;
}

/* ========== 加减操作行 ========== */
.calc-op-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========== 按鈕行 ========== */
.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.dt-btn-primary {
    padding: 8px 18px;
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.dt-btn-primary:hover {
    background: linear-gradient(135deg, #4c51bf 0%, #5a67d8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.dt-btn-primary:active { transform: translateY(0); }

.dt-btn-secondary {
    padding: 8px 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dt-btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ========== 分割线 ========== */
.divider {
    height: 1px;
    background: linear-gradient(to right, #e2e8f0 60%, transparent);
    margin: 16px 0;
}

/* ========== 结果列表 ========== */
.result-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 空状态提示 */
.empty-state {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 52px 20px;
    background: white;
    border-radius: 10px;
    border: 1px dashed #dde3ef;
    line-height: 1.9;
}

.empty-state::before {
    content: '📅';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state strong { color: #667eea; }

/* 结果分组标题 */
.result-group-title {
    font-size: 10px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 4px 3px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #edf2f7;
}

/* ========== 结果项 ========== */
@keyframes dtFadeSlide {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-item {
    display: flex;
    align-items: stretch;
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    animation: dtFadeSlide 0.18s ease both;
}

.result-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

/* 高亮第一行（主格式） */
.result-item.highlight {
    border-color: #a5b4fc;
    background: linear-gradient(to right, #f5f3ff, #faf7ff);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.result-item.highlight .result-label {
    background: linear-gradient(to bottom, #ede9fe, #e8e4fc);
    border-right-color: #a5b4fc;
    color: #5a67d8;
}

.result-item.highlight .result-value {
    color: #4338ca;
    font-weight: 700;
    font-size: 14px;
}

/* 标签列 */
.result-label {
    width: 188px;
    min-width: 140px;
    padding: 9px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border-right: 1px solid #edf2f7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

/* 值列 */
.result-value {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    color: #1e293b;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    word-break: break-all;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* 复制按鈕 */
.result-copy-btn {
    width: 34px;
    min-height: 36px;
    background: transparent;
    border: none;
    border-left: 1px solid #edf2f7;
    color: #b0bac9;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.result-copy-btn:hover {
    background: #f0f4ff;
    color: #667eea;
}

.result-copy-btn.copied {
    color: #10b981;
    background: #f0fdf4;
}

/* ========== 错误提示框 ========== */
.error-box {
    padding: 10px 14px;
    background: linear-gradient(to right, #fef2f2, #fff8f8);
    border: 1px solid #fecaca;
    border-left: 3px solid #ef4444;
    border-radius: 6px;
    color: #ef4444;
    font-size: 12.5px;
    margin-top: 10px;
    line-height: 1.5;
    font-weight: 500;
}

/* ========== Toast 通知 ========== */
.dt-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
}

.dt-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
    .dt-two-panel {
        flex-direction: column;
        min-height: unset;
    }

    .dt-input-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .toolbar-tabs {
        gap: 3px;
        padding: 2px;
    }

    .tab-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .dt-live-clock {
        font-size: 13px;
        min-width: 80px;
        letter-spacing: 1px;
    }

    .result-label {
        width: 120px;
        min-width: 100px;
        font-size: 11px;
    }
}
