/* ============================================================
   🎨 프리미엄 다크 테마 디자인 시스템
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2d;
    --bg-elevated: #1f1f2e;

    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --text-tertiary: #6b6b85;
    --text-accent: #a78bfa;

    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --header-height: 56px;
    --tabbar-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { color: var(--text-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    outline: none;
}

img { max-width: 100%; display: block; }

/* ── Screens ── */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}
.screen.active { display: flex; flex-direction: column; }

/* ═══════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 14px;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.feature-item:hover { background: var(--bg-card-hover); }

.feature-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* Google 로그인 버튼 */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #333;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.google-btn:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-terms {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.login-terms a {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════
   APP HEADER
   ═══════════════════════════════════ */
#app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
}

.header-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.header-back-btn:hover {
    background: var(--bg-tertiary);
}

.header-back-btn.hidden {
    display: none;
}

/* 게스트(미로그인) 모드: 공유피드만 노출 */
.header-login-btn {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

body:not(.guest-mode) #header-login-btn { display: none; }
body.guest-mode #user-avatar { display: none; }

/* 인증 필요 탭을 숨기지 않고, 클릭 시 로그인 유도(app.js에서 처리) */

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

.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
}

.header-icon-btn svg {
    width: 20px;
    height: 20px;
}

.header-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--border-active);
    cursor: pointer;
    transition: transform 0.2s;
}

.header-avatar:hover { transform: scale(1.05); }

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ═══════════════════════════════════
   PAGE CONTAINER & PAGES
   ═══════════════════════════════════ */
#page-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.page {
    display: none;
    min-height: 100%;
}

.page.active {
    display: block;
    animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-content {
    padding: 20px;
    padding-bottom: calc(var(--tabbar-height) + var(--safe-area-bottom) + 20px);
}

/* ═══════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════ */
.welcome-section {
    margin-bottom: 24px;
}

.welcome-text {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-sub {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.action-card:active {
    transform: translateY(0);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.action-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.see-all {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Activity List */
.activity-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Premium Banner */
.premium-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
}

.premium-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.premium-badge {
    background: var(--accent-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.premium-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.premium-content p {
    font-size: 12px;
    color: var(--text-secondary);
}

.premium-btn {
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════ */
.profile-header {
    text-align: center;
    padding: 20px 0 24px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.plan-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-badge.free {
    background: rgba(107, 107, 133, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 107, 133, 0.3);
}

.plan-badge.pro {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Profile Menu */
.profile-menu {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover { background: var(--bg-card-hover); }

.menu-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.menu-icon {
    font-size: 18px;
    width: 28px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.menu-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

.menu-divider {
    height: 8px;
    background: var(--bg-primary);
}

.menu-item.danger .menu-text {
    color: var(--danger);
}

/* ═══════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════ */
.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: -1px;
}

.setting-item:first-of-type { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.setting-item:last-of-type { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.setting-item:only-of-type { border-radius: var(--radius-md); }

.setting-info { flex: 1; }

.setting-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
}

.setting-desc {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.setting-value {
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.setting-select:focus {
    border-color: var(--accent-primary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 28px;
    transition: 0.3s;
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* ═══════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dash-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 18px;
}

.dash-card.full-width {
    grid-column: 1 / -1;
}

.dash-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dash-card-icon { font-size: 18px; }

.dash-card-header h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.dash-card-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.dash-card-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.dash-card-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-accent);
    min-width: 40px;
    text-align: right;
}

.chart-placeholder {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ═══════════════════════════════════
   TAB BAR
   ═══════════════════════════════════ */
#tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(var(--tabbar-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-tertiary);
    transition: color 0.2s;
    position: relative;
}

.tab-item svg {
    width: 22px;
    height: 22px;
}

.tab-item span {
    font-size: 11px;
    font-weight: 500;
}

.tab-item.active {
    color: var(--accent-primary);
}

.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 0 0 2px 2px;
}

/* ═══════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════ */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 40px);
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    font-size: 14px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ═══════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════ */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ═══════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════ */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 380px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .premium-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (min-width: 768px) {
    .login-card {
        padding: 48px 40px;
    }

    .page-content {
        max-width: 640px;
        margin: 0 auto;
    }
}

/* ── Light Theme Variables ── */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-elevated: #ffffff;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* ── Light Theme: fix hard-coded inline dark colors ── */
/* 동적 생성 카드/모달의 인라인 스타일은 CSS 변수를 쓰지 않아 라이트모드에서도
   다크 색이 남습니다. data-theme=light 일 때 해당 색을 테마에 맞게 덮어씁니다.
   (인라인 스타일 우선순위를 넘기 위해 !important 사용) */
[data-theme="light"] [style*="BACKGROUND:#15151F" i],
[data-theme="light"] [style*="background:#15151f" i],
[data-theme="light"] [style*="BACKGROUND:#16161F" i],
[data-theme="light"] [style*="background:#16161f" i],
[data-theme="light"] [style*="BACKGROUND:#1F1F2E" i],
[data-theme="light"] [style*="background:#1f1f2e" i],
[data-theme="light"] [style*="BACKGROUND:#0F0F16" i],
[data-theme="light"] [style*="background:#0f0f16" i] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] [style*="BORDER:1PX SOLID #2A2A35" i],
[data-theme="light"] [style*="border:1px solid #2a2a35" i],
[data-theme="light"] [style*="BORDER:1PX SOLID #374151" i],
[data-theme="light"] [style*="border:1px solid #374151" i] {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] [style*="COLOR:#9CA3AF" i],
[data-theme="light"] [style*="color:#9ca3af" i] { color: #4b5563 !important; }

[data-theme="light"] [style*="COLOR:#D1D5DB" i],
[data-theme="light"] [style*="color:#d1d5db" i] { color: #374151 !important; }

[data-theme="light"] [style*="COLOR:#E5E7EB" i],
[data-theme="light"] [style*="color:#e5e7eb" i] { color: #1f2937 !important; }

[data-theme="light"] [style*="COLOR:#F3F4F6" i],
[data-theme="light"] [style*="color:#f3f4f6" i] { color: #111827 !important; }

/* 설정/모달 등 떠 있는 패널(.setting-item, manage-menu, modal content)은
   라이트모드에서도 살짝 어두운 표면이 자연스러우므로 밝은 회색으로 처리 */
[data-theme="light"] .setting-item,
[data-theme="light"] .manage-menu,
[data-theme="light"] #reading-modal .modal-content,
[data-theme="light"] [id="install-prompt"] > div {
    background: #f3f4f6 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
