/* ==========================================
   人民币大写转换工具 - 专用样式
   依赖: tools-common.css
   ========================================== */

/* ==========================================
   1. 输入区域
   ========================================== */
.input-section {
    margin-bottom: 30px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 12px;
}

.input-label i {
    color: var(--primary-color, #3498db);
    font-size: 1.1rem;
}

.input-wrapper {
    position: relative;
}

.amount-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 1.5rem;
    font-weight: 500;
    color: #2c3e50;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Consolas', 'Monaco', monospace;
}

.amount-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.amount-input.error {
    border-color: #e74c3c;
    animation: shake 0.3s ease;
}

.input-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.input-hint.error {
    color: #e74c3c;
    font-weight: 500;
}

/* 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==========================================
   2. 实时转换开关
   ========================================== */
.auto-convert-switch {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch-container input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.switch-container input:checked + .switch-slider {
    background-color: #3498db;
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-label {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
}

/* ==========================================
   3. 快捷示例
   ========================================== */
.example-section {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.example-header i {
    color: #ffc107;
    font-size: 1.1rem;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.example-btn {
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    background-color: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Monaco', monospace;
}

.example-btn:hover {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.example-btn:active {
    transform: translateY(0);
}

/* ==========================================
   4. 操作按钮
   ========================================== */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #7f8c8d;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #bdc3c7;
    color: #2c3e50;
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* ==========================================
   5. 结果显示区
   ========================================== */
.result-section {
    margin-bottom: 30px;
    animation: fadeIn 0.4s ease;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #27ae60;
}

.result-header i {
    font-size: 1.3rem;
}

.result-card {
    position: relative;
    padding: 30px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #b8dabd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
}

.result-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #155724;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: break-all;
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
}

.result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.btn-copy {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

.btn-copy:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(39, 174, 96, 0.4);
}

.btn-copy:active {
    transform: translateY(0);
}

.result-time {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* 复制成功提示 */
.copy-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10;
    white-space: nowrap;
}

.copy-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ==========================================
   6. 历史记录
   ========================================== */
.history-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    animation: fadeIn 0.4s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #dee2e6;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.history-title i {
    color: #6c757d;
    font-size: 1.1rem;
}

.history-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
}

.btn-text {
    padding: 6px 12px;
    font-size: 0.875rem;
    color: #dc3545;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-text:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #c82333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 15px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.history-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateX(5px);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-amount {
    font-size: 0.95rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.history-item-result {
    font-size: 0.875rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.history-empty {
    text-align: center;
    padding: 30px 20px;
    color: #adb5bd;
    font-size: 0.95rem;
}

.history-empty i {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

/* ==========================================
   7. 动画
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   8. 响应式设计
   ========================================== */

/* 平板端（768px - 1024px） */
@media (max-width: 1024px) {
    .amount-input {
        font-size: 1.3rem;
        padding: 16px 18px;
    }

    .result-text {
        font-size: 1.5rem;
    }

    .example-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

/* 手机端（< 768px） */
@media (max-width: 768px) {
    .amount-input {
        font-size: 1.1rem;
        padding: 14px 16px;
    }

    .result-text {
        font-size: 1.2rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .example-section {
        padding: 15px;
    }

    .example-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .example-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .result-card {
        padding: 20px;
    }

    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .result-time {
        text-align: center;
    }

    .history-section {
        padding: 15px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-item-time {
        align-self: flex-end;
    }

    .auto-convert-switch {
        justify-content: flex-start;
    }
}

/* 小屏手机（< 480px） */
@media (max-width: 480px) {
    .amount-input {
        font-size: 1rem;
        padding: 12px 14px;
    }

    .result-text {
        font-size: 1.1rem;
    }

    .example-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .input-label,
    .example-header,
    .result-header,
    .history-title {
        font-size: 0.95rem;
    }
}
