:root {
    --bg: #0d0d1a;
    --bg-card: #1a1a2e;
    --accent: #00d4ff;
    --accent2: #7c3aed;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #2d2d4e;
    --header-height: 60px;
    --header-bg1: #0d0d1a;
    --header-bg2: #1a1a2e;
    --header-shadow: rgba(0, 212, 255, 0.15);
}

body.light {
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --accent: #0077aa;
    --accent2: #6d28d9;
    --text: #1a1a2e;
    --text-muted: #4a5568;
    --border: #cbd5e0;
    --header-bg1: #ffffff;
    --header-bg2: #e8f0f8;
    --header-shadow: rgba(0, 119, 170, 0.12);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.header {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--header-bg1) 0%, var(--header-bg2) 100%);
    border-bottom: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 20px var(--header-shadow);
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fixed-clock {
    font-size: 16px;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.btn-top {
    padding: 4px 12px;
    border: 1px solid var(--accent2);
    color: var(--accent2);
    border-radius: 4px;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-top:hover {
    background: var(--accent2);
    color: #fff;
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.5);
}

.main-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.btn {
    padding: 5px 16px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
}

.btn:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.4);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.schedule-table td,
.schedule-table th {
    font-size: 16px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.schedule-table tr:first-child td {
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-table td:first-child {
    width: 54px;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 17px;
    border-right: 1px solid var(--border);
}

.schedule-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.current-hour td {
    background: rgba(0, 255, 153, 0.08) !important;
    border-left: 3px solid #00ff99;
}

.current-hour td:first-child {
    color: #00ff99 !important;
}

.form-control {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    resize: none;
    outline: none;
    padding: 4px 0;
    font-family: inherit;
    line-height: 1.6;
    overflow: hidden;
}

.form-control::placeholder {
    color: var(--border);
}

.form-control:focus {
    background: rgba(0, 212, 255, 0.04);
    border-radius: 4px;
    padding: 4px 6px;
}

/* フッター */
footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 17px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

footer a {
    color: var(--accent2);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* テーマ切り替えボタン */
.btn-theme {
    padding: 4px 12px;
    border: 1px solid var(--text-muted);
    background: transparent;
    color: var(--text);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-theme:hover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

/* ヘルプボタン */
.btn-help {
    padding: 4px 12px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-help:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.4);
}

/* モーダル */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.modal-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    margin: 16px 0 6px;
    letter-spacing: 0.05em;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.modal-body code {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    color: var(--accent);
}

.modal-body .code-block {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    color: var(--accent);
    line-height: 2;
}

.modal-body .note {
    background: rgba(124, 58, 237, 0.1);
    border-left: 3px solid var(--accent2);
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    margin-top: 12px;
    color: var(--text-muted);
}
