/**
 * 子乐工具箱 - 自定义样式
 * 保持 Layui 原有配色，增强交互体验
 */

/* ==================== CSS Variables ==================== */
:root {
    /* 保持 Layui 原有配色 */
    --primary-color: #009688;
    --primary-dark: #00796b;

    /* Accent Colors */
    --accent-cyan: #00d2d3;
    --accent-green: #5FB878;
    --accent-yellow: #FFB800;
    --accent-red: #FF5722;

    /* Background */
    --bg-light: #f2f2f2;
    --bg-card-light: #ffffff;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.1);

    /* Text Colors */
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;

    /* Border & Radius */
    --border-color: rgba(0, 0, 0, 0.06);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ==================== Global Enhancements ==================== */
html {
    background: var(--bg-light);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Smooth scrolling */
html,
body {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c2c2c2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==================== Card Enhancements ==================== */
.layui-card {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.layui-card:hover {
    box-shadow: var(--shadow-hover);
}

.layui-card-header {
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 15px 20px;
    font-size: 14px;
}

.layui-card-body {
    padding: 20px;
}

/* ==================== Button Enhancements ==================== */
.layui-btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
}

.layui-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.layui-btn:active {
    transform: translateY(0);
}

/* ==================== Form Enhancements ==================== */
.layui-input,
.layui-textarea,
.layui-select {
    border-radius: var(--radius-sm);
    border: 1px solid #e6e6e6;
    transition: all var(--transition-fast);
}

.layui-input:focus,
.layui-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
    outline: none;
}

.layui-form-label {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== Quote Block Enhancement ==================== */
.layui-elem-quote {
    background: rgba(0, 150, 136, 0.06);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 15px 20px;
    font-weight: 500;
}

/* ==================== Hero Section ==================== */
.hero-section {
    background: var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
}

.hero-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 15px;
    opacity: 0.9;
}

/* ==================== Feature Cards ==================== */
.feature-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 25px;
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.feature-card .feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: #fff;
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== Tool Cards ==================== */
.tool-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-hover);
    background: rgba(0, 150, 136, 0.03);
}

.tool-card .tool-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.tool-card .tool-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-card .tool-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== Timer Section ==================== */
.timer-section {
    background: var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
}

.timer-section h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.timer-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: conic-gradient(rgba(255, 255, 255, 0.9) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.2) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
}

.timer-circle-inner {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle span {
    font-size: 28px;
    font-weight: 700;
}

.timer-label {
    font-size: 13px;
    opacity: 0.8;
}

.otp-preview {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.otp-digit {
    width: 36px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Consolas', monospace;
}

/* ==================== Password Output ==================== */
.password-output {
    font-family: 'Consolas', 'Fira Code', monospace;
    background: #2d3436;
    color: #00cec9;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.8;
    min-height: 250px;
    resize: vertical;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.password-output:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.2);
}

/* ==================== Stats Cards ==================== */
.stat-card,
.stat-item {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-light);
}

.stat-item {
    flex: 1;
}

.stat-card .stat-value,
.stat-item .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label,
.stat-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.stat-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* ==================== Footer Enhancement ==================== */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--primary-dark);
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

/* ==================== Quick Tip ==================== */
.quick-tip {
    background: rgba(0, 150, 136, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.quick-tip strong {
    color: var(--primary-color);
}

/* ==================== Code Area ==================== */
.code-area {
    display: flex;
    gap: 20px;
}

@media (max-width: 768px) {
    .code-area {
        flex-direction: column;
    }
}

.code-area>div {
    flex: 1;
}

.key-input {
    font-family: 'Consolas', monospace;
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
    border-radius: var(--radius-md);
    padding: 15px;
    font-size: 13px;
    line-height: 2;
    min-height: 280px;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.key-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
    outline: none;
}

.otp-output {
    font-family: 'Consolas', monospace;
    background: #2d3436;
    color: #00cec9;
    border-radius: var(--radius-md);
    padding: 15px;
    font-size: 15px;
    line-height: 2;
    min-height: 280px;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    border: none;
}

.otp-output:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.2);
}

/* ==================== Action Buttons ==================== */
.action-buttons,
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-row {
    margin-top: 12px;
}

/* ==================== Setting Page ==================== */
.setting-group {
    margin-bottom: 25px;
}

.setting-group-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 150, 136, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-tip {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* ==================== Password Options ==================== */
.password-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.password-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-option label {
    font-size: 14px;
    color: var(--text-secondary);
}

.length-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.length-slider input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--primary-color);
    border-radius: 3px;
    outline: none;
}

.length-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.length-value {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

/* ==================== Responsive ==================== */
@media screen and (max-width: 768px) {
    .hero-section {
        padding: 30px 20px;
    }

    .hero-section h1 {
        font-size: 22px;
    }

    .feature-card {
        padding: 20px;
    }

    .otp-digit {
        width: 32px;
        height: 40px;
        font-size: 16px;
    }

    .stat-row {
        flex-direction: column;
    }
}