/* ============================================
   BASE.CSS - CSS変数、リセット、基本スタイル
   ============================================ */

/* ライトモード（デフォルト） */
:root,
body[data-theme="light"] {
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-light: #0f172a;
    --border: #e2e8f0;
    --hover-bg: #f1f5f9;
    --empty-bg: #f8fafc;
    --today-bg: #eff6ff;
    --today-border: #3b82f6;
    --cell-hover-bg: #f0f8ff;
    --section-bg: rgba(59, 130, 246, 0.08);
    --primary: #3b82f6;
    --primary-dark: #2563eb;

    --profit: #dc2626;
    --loss: #16a34a;

    --sun: #dc2626;
    --sat: #2563eb;

    /* 角R統一変数 */
    --card-radius: 5px;
}

/* ダークモード */
body[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #475569;
    --hover-bg: #334155;
    --empty-bg: #0f172a;
    --today-bg: #1e3a8a;
    --today-border: #60a5fa;
    --cell-hover-bg: #334155;
    --section-bg: rgba(59, 130, 246, 0.15);
    --primary: #60a5fa;
    --primary-dark: #3b82f6;

    --profit: #ef4444;
    --loss: #22c55e;

    --sun: #ef4444;
    --sat: #60a5fa;
}

body[data-theme="dark"] .calendar {
    background: #1e293b;
    border-color: #475569;
}

body[data-theme="dark"] .day-cell {
    background: #0f172a;
    border-color: #334155;
}

body[data-theme="dark"] .weekday-header {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #94a3b8;
    border-bottom-color: #334155;
}

body[data-theme="dark"] .day-number {
    color: #f1f5f9;
}

body[data-theme="dark"] .category-value-line {
    color: #f1f5f9;
}

body[data-theme="dark"] .comment-line {
    color: #f1f5f9;
}

body[data-theme="dark"] header h1 {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Saira', 'Zen Kaku Gothic New', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
    display: block;
}