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

:root {
    --primary: #4F46E5;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* 黑屏模式 */
#blackScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#blackScreen.hidden {
    display: none;
}

.clock {
    font-size: 4rem;
    font-weight: 200;
    color: #333;
    margin-bottom: 2rem;
}

.task-name {
    font-size: 1.2rem;
    color: #222;
    opacity: 0.5;
}

/* 主界面 */
header {
    padding: 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

main {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 当前任务卡片 */
.current-task-card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-priority.HIGH {
    background: var(--danger);
    color: white;
}

.task-priority.MEDIUM {
    background: var(--warning);
    color: white;
}

.task-priority.LOW {
    background: var(--text-secondary);
    color: white;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
}

.current-task-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.task-timer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.time-display {
    display: flex;
    flex-direction: column;
}

.time-display .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.time-display .value {
    font-size: 1.5rem;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
}

/* 语音控制 */
.voice-control {
    text-align: center;
    margin-bottom: 2rem;
}

.voice-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s;
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn .icon {
    font-size: 1.5rem;
}

.voice-status {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-height: 1.5rem;
}

/* 任务列表 */
.task-list h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.task-item {
    background: var(--bg-card);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item.completed {
    opacity: 0.5;
}

.task-item-info {
    flex: 1;
}

.task-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.task-item-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.task-item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
}

/* 生存模式 */
.survival-mode {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.survival-mode label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.record-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    cursor: pointer;
}

#recordingStatus {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

/* 编辑控制按钮 */
.edit-controls {
    margin-bottom: 1rem;
    text-align: right;
}

.edit-btn {
    background: #003d82;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn:hover {
    background: #002a5c;
    transform: translateY(-2px);
}

/* 编辑弹窗 */
.edit-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.close-btn:hover {
    color: #003d82;
}

.edit-instructions {
    background: #f0f7ff;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #003d82;
}

/* 可编辑任务列表 */
.edit-task-list {
    margin-bottom: 1rem;
}

.edit-task-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.3s;
    touch-action: none;
}

.edit-task-item:hover {
    border-color: #003d82;
    box-shadow: 0 2px 8px rgba(0, 61, 130, 0.1);
}

.edit-task-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.edit-task-item.drag-over {
    border-color: #003d82;
    border-style: dashed;
}

.edit-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.edit-task-title {
    font-weight: 600;
    font-size: 1rem;
    color: #003d82;
}

.edit-task-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.drag-handle {
    font-size: 1.2rem;
    color: #999;
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* 编辑操作按钮 */
.edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-task-btn {
    flex: 1;
    background: #f0f7ff;
    color: #003d82;
    border: 2px dashed #003d82;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.add-task-btn:hover {
    background: #003d82;
    color: white;
}

.save-btn {
    flex: 1;
    background: #003d82;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    background: #002a5c;
}

/* 任务详情编辑弹窗 */
.task-detail-modal {
    max-width: 400px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #003d82;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #003d82;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #c82333;
}

.cancel-btn {
    flex: 1;
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: #e0e0e0;
}
