/* ============================================
   全局样式设置
   ============================================ */

/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根元素样式 */
:root {
    /* 深色主题配色 */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #252525;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-accent: #4ade80;
    --text-warning: #fbbf24;
    --border-color: #404040;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* 页面主体样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    padding: 20px;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    min-width: 320px;
}

/* ============================================
   标题区域样式
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    height: 120px;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ============================================
   主要内容区域样式
   ============================================ */

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

/* 收入统计和工作信息区域的基础样式 */
.income-section,
.work-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.income-section:hover,
.work-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.6);
}

/* 设置区域样式 */
.settings-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 15px 0;
    transition: all 0.3s ease;
}

.settings-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.4);
}

.settings-section .section-title {
    margin-bottom: 12px;
    font-size: 1rem;
}

/* 设置表单样式 */
.settings-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.settings-form .input-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.settings-form .label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.settings-form .input {
    padding: 8px 10px;
    font-size: 0.9rem;
}

.settings-form .save-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    margin-top: 0;
    height: fit-content;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* ============================================
   输入区域样式
   ============================================ */

.input-group {
    margin-bottom: 20px;
}

.label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input:hover {
    border-color: #555;
}

/* 保存按钮样式 */
.save-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

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

/* ============================================
   收入统计区域样式
   ============================================ */

/* 已挣金额显示 */
.earned-amount {
    text-align: center;
    margin-bottom: 20px;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(34, 211, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.earned-amount::before {
    content: '💰';
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.6;
    font-size: 1.5rem;
}

.earned-amount .amount-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.earned-amount .amount-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-accent);
    text-shadow: 0 0 25px rgba(34, 211, 238, 0.5);
}

/* 剩余金额显示 */
.remaining-amount {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    position: relative;
    overflow: hidden;
}

.remaining-amount::before {
    content: '⏰';
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.6;
    font-size: 1.5rem;
}

.remaining-amount .amount-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.remaining-amount .amount-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-warning);
}

/* ============================================
   工作信息区域样式
   ============================================ */

/* 进度条容器 */
.progress-container {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 14px;
    background: var(--bg-primary);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 7px;
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
    width: 0%;
}

/* 倒计时和工作时长网格 */
.work-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 倒计时显示 */
.countdown {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* 已工作时长显示 */
.work-time {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 10px;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.time-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.time-value {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   底部消息区域样式
   ============================================ */

.message-container {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    min-height: 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.message-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.6);
}

.footer {
    margin-top: 20px;
}

.message-icon {
    font-size: 1.8rem;
    margin-right: 12px;
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.message-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
    transition: all 1.2s ease;
}

/* ============================================
   响应式设计
   ============================================ */

/* 平板设备 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .work-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .income-section,
    .work-section {
        padding: 20px;
    }

    .earned-amount .amount-value,
    .remaining-amount .amount-value {
        font-size: 2.8rem;
    }

    .countdown-value {
        font-size: 1.6rem;
    }

    .time-value {
        font-size: 1.2rem;
    }

    .message-text {
        font-size: 1rem;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .header {
        margin-bottom: 25px;
        padding: 15px 0;
    }

    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .income-section,
    .work-section {
        padding: 18px;
    }

    .settings-section {
        padding: 14px;
        margin: 12px 0;
    }

    .settings-form {
        gap: 10px;
    }

    .settings-form .input-group {
        min-width: 100px;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .earned-amount .amount-value,
    .remaining-amount .amount-value {
        font-size: 2.4rem;
    }

    .countdown-value {
        font-size: 1.4rem;
    }

    .time-value {
        font-size: 1.1rem;
    }

    .message-container {
        padding: 14px 16px;
        min-height: 50px;
        margin: 12px 0;
    }

    .message-text {
        font-size: 0.9rem;
    }

    .message-icon {
        font-size: 1.4rem;
        margin-right: 8px;
    }
}

/* 超小屏幕设备 */
@media (max-width: 320px) {
    body {
        padding: 10px;
    }

    .title {
        font-size: 1.5rem;
    }

    .earned-amount .amount-value,
    .remaining-amount .amount-value {
        font-size: 2rem;
    }

    .countdown-value {
        font-size: 1.2rem;
    }

    .time-value {
        font-size: 1rem;
    }

    .income-section,
    .work-section,
    .settings-section {
        padding: 15px;
    }

    .settings-form {
        flex-direction: column;
        gap: 8px;
    }

    .settings-form .input-group {
        min-width: unset;
        width: 100%;
    }

    .message-container {
        padding: 12px 14px;
        min-height: 45px;
        margin: 10px 0;
        flex-wrap: wrap;
    }

    .message-text {
        font-size: 0.85rem;
        flex-basis: calc(100% - 2rem);
    }

    .message-icon {
        font-size: 1.2rem;
        margin-right: 6px;
        margin-bottom: 4px;
    }
}

