:root {
    /* Purple Cozy Stone Theme */
    --primary-color: #7C3AED;
    --primary-hover: #6D28D9;
    --bg-color: #FAF5FF;
    --card-bg: #FFFFFF;
    --text-main: #4C1D95;
    --text-muted: #8B5CF6;
    --border-color: #E2E8F0;
    --danger-color: #dc3545;
    --success-color: #28a745;
    
    --font-base: 20px;
    --font-title: 28px;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(124, 58, 237, 0.08); /* slight purple shadow */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: var(--font-base);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    padding: 20px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: var(--font-title);
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* 按钮基础样式 */
button {
    font-family: inherit;
    font-size: var(--font-base);
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 14px 24px;
    font-weight: 500;
    width: 100%;
    min-height: 56px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
}

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

/* 翻译区样式 */
.language-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #F3E8FF;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lang-label {
    font-weight: bold;
    color: var(--primary-color);
    flex: 1;
    text-align: center;
}

.swap-btn {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.swap-btn:hover {
    background: var(--primary-color);
    color: white;
}

.swap-btn svg {
    width: 28px;
    height: 28px;
}

.text-areas {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* 语音输入部分 */
.textarea-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}
.empty-header {
    height: 48px;
}
.mic-btn {
    background: #EDE9FE;
    border: 1px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}
.mic-btn:hover {
    background: #DDD6FE;
}
.mic-btn.recording {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

textarea {
    width: 100%;
    min-height: 150px;
    font-family: inherit;
    font-size: var(--font-base);
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.2s;
    color: var(--text-main);
    background: white;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

#target-text {
    background-color: #F8FAFC;
}

.status-message {
    margin-top: 15px;
    text-align: center;
    font-size: 18px;
    min-height: 27px;
}

.status-error { color: var(--danger-color); }
.status-success { color: var(--primary-color); }

/* 待办布局 */
.todo-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 900px) {
    .todo-layout {
        flex-direction: row;
    }
    .todo-left {
        flex: 3;
    }
    .todo-right {
        flex: 2;
        min-width: 350px;
    }
}

/* 高级待办区样式 */
.todo-advanced-form {
    background: #F8FAFC;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.full-width {
    width: 100%;
    font-family: inherit;
    font-size: var(--font-base);
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.full-width:focus {
    outline: none;
    border-color: var(--primary-color);
}

.todo-dates {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.date-field, .color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-field label, .color-field label {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
}

.date-field input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 18px;
    color: var(--text-main);
}

.color-picker {
    display: flex;
    gap: 10px;
}

.color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--text-main);
    transform: scale(1.1);
}

/* 待办卡片 */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.todo-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(124,58,237,0.04);
}

.todo-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.todo-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.todo-checkbox {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.todo-card-title {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
}

.todo-card.completed .todo-card-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-task-btn {
    background: transparent;
    color: var(--danger-color);
    padding: 10px 15px;
    font-size: 18px;
    border: 1px solid var(--danger-color);
}

.delete-task-btn:hover {
    background: #ffe6e6;
}

.todo-card-dates {
    display: flex;
    gap: 20px;
    font-size: 16px;
    color: var(--primary-color);
    background: #F3E8FF;
    padding: 12px 16px;
    border-radius: 8px;
    flex-wrap: wrap;
    font-weight: 500;
}

.todo-nav-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 节点样式 */
.todo-nodes-container {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.nodes-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.node-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.node-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FAFC;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.node-text {
    flex: 1;
    font-size: 18px;
}

.node-item.completed .node-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-node-btn {
    color: var(--text-muted);
    background: transparent;
    padding: 5px 10px;
}
.delete-node-btn:hover {
    color: var(--danger-color);
}

.add-node-group {
    display: flex;
    gap: 10px;
}

.add-node-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
}

.add-node-btn {
    padding: 10px 20px;
    background: #EDE9FE;
    color: var(--primary-color);
    font-weight: 500;
}
.add-node-btn:hover {
    background: #DDD6FE;
}

/* 日历样式 */
.calendar-container {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(124,58,237,0.04);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 22px;
    color: var(--primary-color);
}

.cal-nav-btn {
    background: #F3E8FF;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav-btn:hover {
    background: var(--primary-color);
    color: white;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #F8FAFC;
    font-size: 16px;
    cursor: default;
    position: relative;
    border: 1px solid transparent;
}

.cal-day:hover {
    border-color: var(--primary-color);
}

.cal-day.empty {
    background: transparent;
    pointer-events: none;
}

.cal-day.today {
    background: #EDE9FE;
    font-weight: bold;
    border-color: var(--primary-color);
}

.cal-dots {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 80%;
}

.cal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

@media (min-width: 768px) {
    .text-areas {
        flex-direction: row;
    }
    .input-group {
        flex: 1;
    }
}
