:root {
    --bg-color: #F7F8FA; --primary-color: #191F28; --text-main: #191F28; --text-sub: #8B95A1; --accent-color: #4C6EF5; --card-bg: #FFFFFF; --border: #E5E8EB; --input-bg: #FFFFFF; --hover-bg: #F2F4F6; --safe-top: env(safe-area-inset-top, 20px); --safe-bottom: env(safe-area-inset-bottom, 20px);
}
[data-theme="dark"] { --bg-color: #000000; --primary-color: #F2F2F7; --text-main: #F2F2F7; --text-sub: #98989D; --card-bg: #1C1C1E; --border: #2C2C2E; --input-bg: #1C1C1E; --hover-bg: #2C2C2E; --accent-color: #0A84FF; }

* { box-sizing: border-box; }

body { font-family: "Pretendard", -apple-system, sans-serif; background-color: var(--bg-color); color: var(--text-main); margin: 0; padding: 0; -ms-overflow-style: none; scrollbar-width: none; }
body::-webkit-scrollbar { display: none; }
a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

#splash-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--card-bg); z-index: 99999; display: flex; justify-content: center; align-items: center; flex-direction: column; transition: opacity 0.6s ease-out, visibility 0.6s; }
#splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; animation: fadeUp 0.8s ease-out; }
.splash-logo { width: 100px; height: 100px; margin-bottom: 15px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.splash-title { font-size: 28px; font-weight: 900; color: var(--text-main); margin: 0; letter-spacing: -0.5px; }
.splash-desc { font-size: 14px; color: var(--text-sub); margin-top: 8px; font-weight: 500; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.mobile-frame { width: 100%; max-width: 420px; margin: 0 auto; min-height: 100vh; background-color: var(--bg-color); position: relative; box-shadow: 0 0 30px rgba(0,0,0,0.05); }

.app-header { background: var(--bg-color); padding: calc(10px + var(--safe-top)) 20px 20px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--accent-color); letter-spacing: -0.5px; }
.header-icons { display: flex; gap: 12px; align-items: center; }
.icon-btn { background: none; border: none; padding: 4px; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; position: relative; }
.noti-dot { position: absolute; top: 4px; right: 6px; width: 4px; height: 4px; background: #FF3B30; border-radius: 50%; }
.header-greeting h1 { font-size: 24px; line-height: 1.35; font-weight: 400; margin: 0 0 24px 0; color: var(--text-main); }
.header-greeting h1 strong { font-weight: 800; }

.real-search-bar { background: var(--input-bg); border-radius: 12px; padding: 0 16px; display: flex; align-items: center; height: 48px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid transparent; transition: border-color 0.2s; }
.real-search-bar:focus-within { border-color: var(--accent-color); }
.search-icon-svg { width: 20px; height: 20px; color: var(--text-sub); margin-right: 8px; flex-shrink: 0; }
.real-search-bar input { border: none; outline: none; font-size: 15px; width: 100%; font-family: inherit; color: var(--text-main); background: transparent; height: 100%; }
.real-search-bar input::placeholder { color: var(--text-sub); }

.grid-container { padding: 0 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-bottom: 120px; }
.card { background: var(--card-bg); border-radius: 20px; padding: 20px; height: 140px; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.1s; }
.card:active { transform: scale(0.98); }
.card-text h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-main); }
.card-text p { margin: 6px 0 0; font-size: 12px; color: var(--text-sub); line-height: 1.4; }
.card-icon-svg { align-self: flex-end; width: 40px; height: 40px; color: var(--text-main); opacity: 0.8; }
.card-primary { background: var(--accent-color); color: white; box-shadow: 0 8px 20px rgba(76, 110, 245, 0.3); }
.card-primary .card-text h3 { color: white; }
.card-primary .card-text p { color: rgba(255,255,255,0.8); }
.card-primary .card-icon-svg { color: white; opacity: 1; }
.card-wide { grid-column: span 2; height: auto; min-height: 80px; flex-direction: row; align-items: center; }
.card-wide .card-icon-svg { align-self: center; width: 28px; height: 28px; margin-left: auto; }
.badge { background: #FF3B30; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 4px; }
.card.disabled { background: var(--hover-bg); opacity: 0.7; }
.card.disabled h3, .card.disabled p { color: var(--text-sub); }

.bottom-tab-bar { position: fixed; bottom: 0; left: 0; width: 100%; box-sizing: border-box; height: calc(46px + var(--safe-bottom)); background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); border-top: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-around; padding-bottom: var(--safe-bottom); z-index: 1000; }
[data-theme="dark"] .bottom-tab-bar { background: rgba(28, 28, 30, 0.98); border-top: 1px solid rgba(255,255,255,0.1); }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; padding-top: 4px; cursor: pointer; }
.tab-item.active { color: var(--text-main); }
.tab-icon { width: 20px; height: 20px; margin-bottom: 3px; }
.tab-label { font-size: 9px; font-weight: 500; }

.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: none; opacity: 0; transition: opacity 0.3s; }
.modal-backdrop.active { display: block; opacity: 1; }
.custom-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); width: 85%; max-width: 320px; background: var(--card-bg); border-radius: 16px; z-index: 2100; padding: 20px; opacity: 0; visibility: hidden; transition: all 0.3s; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.custom-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }
.close-modal-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-sub); }
.drawer { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background: var(--card-bg); z-index: 2100; padding: 20px; transform: translateX(100%); transition: transform 0.3s ease-in-out; padding-top: calc(20px + var(--safe-top)); }
.drawer.active { transform: translateX(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.drawer-item { display: block; padding: 15px 0; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--border); color: var(--text-main); }
.divider { border: 0; border-top: 4px solid var(--hover-bg); margin: 10px 0; }
.close-drawer-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-sub); }

.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-radius: 10px; background: var(--hover-bg); }
.settings-label { font-size: 14px; font-weight: 600; color: var(--accent-color); }
.theme-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(20px); }

@media (min-width: 768px) {
    body { background-color: #F0F0F0; display: block; }
    .bottom-tab-bar { width: 100%; max-width: 420px; left: 50%; transform: translateX(-50%); }
}
