/**
 * 时间单位转换器 - 专属样式
 * Time Unit Converter Styles
 */

/* ===== 容器与布局 ===== */
.tuc-container {
    max-width: 680px;
}

.tuc-section {
    margin-bottom: 18px;
}

.tuc-section-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== 时间输入框 ===== */
.tuc-time-input {
    width: 220px;
    padding: 10px 14px;
    font-size: 16px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}

.tuc-time-input:hover {
    border-color: #bbb;
}

.tuc-time-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.tuc-time-input::placeholder {
    color: #aaa;
}

/* ===== 单位选择器 - Toggle Pill 风格 ===== */
.tuc-unit-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tuc-unit-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tuc-unit-group label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    min-width: 50px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    background: #fafafa;
}

.tuc-unit-group label:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f6ff;
}

.tuc-unit-group input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.tuc-unit-group input[type="radio"]:focus + label {
    outline: 2px solid rgba(74, 144, 226, 0.5);
    outline-offset: 2px;
}

/* ===== 交换按钮分隔行 ===== */
.tuc-swap-row {
    display: flex;
    align-items: center;
    margin: 8px 0;
    gap: 12px;
}

.tuc-swap-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

.tuc-swap-btn {
    background: #fff;
    border: 1.5px solid #d0d0d0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    color: #888;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}

.tuc-swap-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f6ff;
    transform: rotate(180deg);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.tuc-swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* ===== 操作按钮行 ===== */
.tuc-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ===== 结果卡片 ===== */
.tuc-result-card {
    background: linear-gradient(135deg, #f0f6ff 0%, #f7fbff 100%);
    border: 1.5px solid #b8d5f8;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 20px;
    display: none;
    position: relative;
}

.tuc-result-card.tuc-show {
    display: block;
    animation: tuc-fadeIn 0.3s ease forwards;
}

.tuc-result-card.tuc-error {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-color: #f5b8b8;
}

/* 错误状态下隐藏复制按钮 */
.tuc-result-card.tuc-error .tuc-copy-btn {
    display: none;
}

@keyframes tuc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tuc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tuc-result-title {
    font-size: 12px;
    color: #999;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.tuc-copy-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.tuc-copy-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.05);
}

.tuc-copy-btn.tuc-copied {
    border-color: #52c41a;
    color: #52c41a;
    background: rgba(82, 196, 26, 0.05);
}

.tuc-result-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.tuc-result-origin {
    font-size: 18px;
    color: #666;
}

.tuc-result-eq {
    font-size: 22px;
    color: #bbb;
    font-weight: 300;
}

.tuc-result-value {
    font-size: 32px;
    font-weight: 700;
    color: #2d6fcd;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
}

.tuc-result-unit {
    font-size: 18px;
    color: #4a90e2;
    font-weight: 500;
}

.tuc-result-error {
    color: #d0021b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== 提交按钮加载态 ===== */
.button.tuc-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
}

.button.tuc-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: tuc-spin 0.6s linear infinite;
}

@keyframes tuc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== 响应式适配 ===== */
@media (max-width: 480px) {
    .tuc-time-input {
        width: 100%;
    }

    .tuc-unit-group label {
        padding: 5px 12px;
        font-size: 12px;
        min-width: 40px;
    }

    .tuc-result-value {
        font-size: 26px;
    }

    .tuc-result-origin,
    .tuc-result-unit {
        font-size: 15px;
    }
}
