/* ============================================================
   DayBoard · 主样式文件
   设计规范: 白色背景 / 蓝色主色 #3B6EF8 / 系统字体
   ============================================================ */

/* ---- Reset & 基础 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #111827;
    background: #f5f7fa;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- CSS 变量 ---- */
:root {
    --primary:      #3B6EF8;
    --primary-light:#EEF2FF;
    --primary-dark: #2855d4;
    --success:      #10B981;
    --warning:      #F59E0B;
    --danger:       #EF4444;
    --gray-50:      #F9FAFB;
    --gray-100:     #F3F4F6;
    --gray-200:     #E5E7EB;
    --gray-300:     #D1D5DB;
    --gray-400:     #9CA3AF;
    --gray-500:     #6B7280;
    --gray-700:     #374151;
    --gray-900:     #111827;
    --white:        #FFFFFF;
    --surface:      #F5F7FA;
    --border:       #E4E7EC;
    --radius-sm:    6px;
    --radius:       8px;
    --radius-lg:    12px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
    --shadow:       0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
    --transition:   0.2s ease;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-light); }

.btn-danger {
    background: transparent;
    color: var(--danger);
}
.btn-danger:hover { background: #FEF2F2; }

.btn-lg {
    height: 48px;
    padding: 0 24px;
    font-size: 16px;
    border-radius: 10px;
}
.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}
.btn-block { width: 100%; justify-content: center; }

/* ---- 输入框 ---- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.form-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,110,248,0.12);
}
.form-input::placeholder { color: var(--gray-400); }

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--white);
    outline: none;
    resize: vertical;
    transition: border-color var(--transition);
}
.form-textarea:focus { border-color: var(--primary); }

/* ---- 标签/优先级 ---- */
.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.tag-high   { background:#FEE2E2; color:#DC2626; }
.tag-medium { background:#FEF3C7; color:#D97706; }
.tag-low    { background:#F3F4F6; color:#6B7280; }

/* ---- 角标 ---- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ---- Toast 提示 ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--gray-900);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}
.toast.success { background: #065F46; }
.toast.error   { background: #7F1D1D; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- 模态框 ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
}
.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 18px;
    transition: background var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}

/* ---- 加载状态 ---- */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 工具类 ---- */
.hidden  { display: none !important; }
.text-center { text-align: center; }
.text-gray   { color: var(--gray-500); }
.text-sm     { font-size: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
