/* ===== 时间加减计算工具样式 ===== */

/* 整体容器 */
.tas-container {
    padding: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

/* ---- 顶部工具栏 ---- */
.tas-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(to bottom, #ffffff, #f5f7fb);
    border-bottom: 1px solid #e3e6ea;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.tas-tabs {
    display: flex;
    gap: 4px;
}

.tas-tab {
    padding: 5px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tas-tab:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f4f8ff;
}

.tas-tab.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.tas-toolbar-actions {
    display: flex;
    gap: 6px;
    margin-left: 4px;
}

.tas-btn-tool {
    padding: 5px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tas-btn-tool:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f6ff;
}

.tas-live-clock {
    margin-left: auto;
    font-size: 18px;
    font-weight: 700;
    color: #4a90e2;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #4a90e2, #6ab0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Tab 面板 ---- */
.tas-pane {
    display: none;
}

.tas-pane.active {
    display: block;
}

/* ---- 双列布局 ---- */
.tas-two-col {
    display: flex;
    gap: 0;
}

.tas-input-panel {
    flex: 0 0 400px;
    padding: 14px 16px;
    border-right: 1px solid #e3e6ea;
    background: #fafbff;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.tas-input-panel::-webkit-scrollbar { width: 4px; }
.tas-input-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.tas-result-panel {
    flex: 1;
    padding: 14px 16px;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.tas-result-panel::-webkit-scrollbar { width: 4px; }
.tas-result-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ---- 小节标题（带左侧彩条） ---- */
.tas-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #4a90e2;
    padding: 3px 0 6px 10px;
    border-bottom: 1px solid #e8edf3;
    margin-bottom: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tas-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 6px;
    width: 3px;
    background: #4a90e2;
    border-radius: 2px;
}

.tas-section-title--gap {
    margin-top: 12px;
}

/* ---- 表单行 ---- */
.tas-form-row {
    margin-bottom: 10px;
}

.tas-form-row > label {
    display: block;
    font-size: 11px;
    color: #8a95a3;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* 输入框带复制按钮 */
.tas-input-with-copy {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tas-text-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #d8dde6;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: 'Consolas', 'Monaco', monospace;
}

.tas-text-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.tas-copy-input-btn {
    padding: 5px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s, color 0.2s;
}

.tas-copy-input-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.tas-copy-input-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
}

/* ---- 分段控制器（加减操作选择）---- */
.tas-seg-ctrl {
    display: inline-flex;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fb;
}

.tas-seg-item {
    cursor: pointer;
    position: relative;
}

.tas-seg-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tas-seg-item span {
    display: block;
    padding: 6px 18px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #d0d5dd;
    user-select: none;
    white-space: nowrap;
}

.tas-seg-item:last-child span {
    border-right: none;
}

.tas-seg-item input[type="radio"]:checked + span {
    background: #4a90e2;
    color: #fff;
    font-weight: 500;
}

/* ---- 时间增量网格 ---- */
.tas-delta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.tas-delta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tas-delta-item label {
    font-size: 10px;
    color: #9aa5b4;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tas-num-input {
    width: 100%;
    padding: 6px 4px;
    border: 1px solid #d8dde6;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s, color 0.2s;
    -moz-appearance: textfield;
}

.tas-num-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.12);
}

/* 已设置非零值时高亮显示 */
.tas-num-input.has-value {
    background: #eef5ff;
    border-color: #90bdf0;
    color: #1a5cb5;
    font-weight: 600;
}

.tas-num-input::-webkit-outer-spin-button,
.tas-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* ---- 快速预设 Chip ---- */
.tas-chip-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tas-chip,
.tas-chip-diff {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid #c5d3e8;
    border-radius: 100px;
    font-size: 12px;
    color: #4a6fa5;
    background: #eef3fb;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.tas-chip:hover,
.tas-chip-diff:hover {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
}

/* ---- 互换按钮行 ---- */
.tas-swap-row {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}

.tas-swap-btn {
    padding: 3px 14px;
    border: 1px dashed #b3c6e0;
    border-radius: 100px;
    background: #f4f8ff;
    color: #4a90e2;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.tas-swap-btn:hover {
    background: #4a90e2;
    border-color: #4a90e2;
    border-style: solid;
    color: #fff;
    transform: translateY(-1px);
}

/* ---- 操作按钮行 ---- */
.tas-action-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tas-btn-primary {
    padding: 8px 22px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.25);
}

.tas-btn-primary:hover {
    background: linear-gradient(135deg, #357abd, #2a68a3);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(74, 144, 226, 0.4);
}

.tas-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

/* 快捷键提示徽标 */
.tas-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    opacity: 0.85;
}

.tas-shortcut kbd {
    padding: 1px 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    font-size: 10px;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ---- 错误框 ---- */
.tas-error-box {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-left: 3px solid #f56565;
    border-radius: 6px;
    font-size: 13px;
    color: #c0392b;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- 结果面板 ---- */
.tas-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 8px;
    border-bottom: 1px solid #e8edf3;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.tas-copy-all-btn {
    padding: 4px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tas-copy-all-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f4f8ff;
}

/* 修复 Flex gap Bug：使 Thymeleaf 结果包裹层对 flex 透明 */
.tas-result-group {
    display: contents;
}

.tas-result-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tas-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #f8f9fc;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tasResultIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tas-result-item:hover {
    background: #eef3fb;
    border-color: #c5d3e8;
}

/* 高亮结果条：左侧彩色边线 */
.tas-result-highlight {
    background: linear-gradient(to right, #edf5ff, #f4f8ff);
    border-color: #b3d0f7;
    border-left: 3px solid #4a90e2;
    padding-left: 8px;
}

.tas-result-highlight:hover {
    background: linear-gradient(to right, #e4f0ff, #eef5ff);
}

.tas-result-label {
    flex: 0 0 150px;
    font-size: 11px;
    color: #9aa5b4;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.4;
}

.tas-result-value {
    flex: 1;
    font-size: 13px;
    color: #2c3e50;
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}

.tas-result-highlight .tas-result-label {
    color: #4a90e2;
}

.tas-result-highlight .tas-result-value {
    font-weight: 700;
    font-size: 15px;
    color: #1a5cb5;
}

.tas-copy-btn {
    flex-shrink: 0;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #bbb;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tas-copy-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f6ff;
}

/* ---- 空状态 ---- */
.tas-empty-state {
    padding: 36px 20px;
    text-align: center;
    color: #bcc4cf;
    font-size: 13px;
    line-height: 2.2;
}

.tas-empty-state strong {
    color: #4a90e2;
}

.tas-empty-state kbd {
    padding: 1px 5px;
    background: #eef3fb;
    border: 1px solid #c5d3e8;
    border-radius: 3px;
    font-size: 11px;
    color: #4a6fa5;
    font-family: inherit;
}

.tas-empty-icon {
    font-size: 38px;
    display: block;
    margin-bottom: 8px;
    animation: tasFloat 2.8s ease-in-out infinite;
}

@keyframes tasFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

@keyframes tasResultIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Toast 通知 ---- */
.tas-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 8px 22px;
    background: rgba(20, 30, 50, 0.88);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.tas-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- 响应式 ---- */
@media (max-width: 780px) {
    .tas-two-col {
        flex-direction: column;
    }

    .tas-input-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e3e6ea;
    }

    .tas-result-label {
        flex: 0 0 100px;
    }

    .tas-live-clock {
        margin-left: 0;
        order: -1;
        width: 100%;
        font-size: 15px;
    }

    .tas-delta-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 500px) {
    .tas-delta-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
