:root {
    --bg-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --nav-bg: rgba(255, 255, 255, 0.35);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --text-main: #1d1d1f;
    --text-sub: #4b5563;
    --primary: #2563eb;
    --input-bg: rgba(255, 255, 255, 0.6);
    --bar-bg: rgba(255, 255, 255, 0.5);
}

body.dark-mode {
    --bg-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --glass-bg: rgba(0, 0, 0, 0.25);
    --nav-bg: rgba(0, 0, 0, 0.4);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --primary: #60a5fa;
    --input-bg: rgba(255, 255, 255, 0.05);
    --bar-bg: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-image: var(--bg-image); background-attachment: fixed; background-size: cover; color: var(--text-main); margin: 0; padding: 0; padding-bottom: 110px; min-height: 100vh; transition: background .3s, color .3s; }
.glass-panel { background: var(--glass-bg); border: var(--glass-border); box-shadow: var(--glass-shadow); border-radius: 24px; padding: 20px; margin-bottom: 20px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.app-header { padding: 15px 20px; position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; background: var(--nav-bg); border-bottom: var(--glass-border); box-shadow: var(--glass-shadow); border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; backdrop-filter: blur(10px); padding-top: max(15px, env(safe-area-inset-top)); }
.app-title { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.theme-btn { background: rgba(255, 255, 255, 0.1); border: var(--glass-border); font-size: 1.2rem; cursor: pointer; padding: 8px; border-radius: 50%; transition: .3s; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; display: none; }
.section { display: none; animation: fadeIn .3s; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; } }
.progress-container { width: 100%; background: var(--bar-bg); border-radius: 15px; margin-bottom: 20px; position: relative; height: 24px; overflow: hidden; border: var(--glass-border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #8b5cf6); width: 0; border-radius: 15px; transition: width 1s ease-in-out; display: flex; align-items: center; justify-content: center; }
.progress-text { position: absolute; width: 100%; text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-main); top: 50%; transform: translateY(-50%); text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
.input-wrapper { position: relative; width: 100%; margin-bottom: 12px; }
input, select, textarea { width: 100%; padding: 14px; padding-right: 40px; font-size: 1rem; background: var(--input-bg); border: var(--glass-border); border-radius: 14px; color: var(--text-main); transition: .3s; font-family: inherit; }
textarea { resize: none; height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: rgba(255, 255, 255, 0.25); }
.clear-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-sub); cursor: pointer; font-size: 1.1rem; display: none; z-index: 2; padding: 5px; }
.btn { width: 100%; padding: 14px; border: none; border-radius: 14px; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: .2s; margin-bottom: 10px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #3b82f6); color: #fff; }
.btn-danger { background: rgba(220, 38, 38, 0.15); color: #ef4444; border: 1px solid #ef4444; }
.btn-outline { background: 0 0; border: 1px solid var(--text-sub); color: var(--text-sub); font-size: .85rem; padding: 8px; }
.btn-return { background: #f97316; color: #fff; border: none; padding: 8px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: .85rem; min-width: 80px; text-align: center; box-shadow: 0 2px 5px rgba(249, 115, 22, 0.4); margin-bottom: 0; }
.btn-comment { background: #8b5cf6; color: #fff; border: none; padding: 8px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: .85rem; min-width: 80px; text-align: center; box-shadow: 0 2px 5px rgba(139, 92, 246, 0.4); margin-bottom: 0; }
.btn-delete { background: rgba(220, 38, 38, 0.1); color: #ef4444; border: 1px solid #ef4444; padding: 4px 10px; font-size: .75rem; border-radius: 8px; margin-left: auto; cursor: pointer; }
.btn-edit-toggle { background: 0 0; border: 1px solid var(--text-sub); color: var(--text-sub); border-radius: 12px; padding: 5px 15px; font-size: .8rem; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.btn-edit-toggle.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-save-small { background: #10b981; color: #fff; border: none; padding: 8px 12px; border-radius: 8px; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(150, 150, 150, 0.15); }
.list-item:last-child { border-bottom: none; }
.item-content { flex: 1; margin-right: 10px; overflow: hidden; }
.item-content h4 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text-main); }
.item-content p { margin: 4px 0 0; font-size: .85rem; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.rank-info { font-size: .75rem; color: var(--primary); margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.medal-container { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 5px; font-size: .9rem; line-height: 1.4; }
.stats-summary { display: flex; gap: 10px; margin-bottom: 20px; }
.summary-box { flex: 1; background: var(--input-bg); border: var(--glass-border); border-radius: 16px; padding: 15px; text-align: center; }
.sb-title { font-size: .75rem; color: var(--text-sub); margin-bottom: 5px; font-weight: 600; }
.sb-value { font-size: 1.1rem; color: var(--primary); font-weight: 800; }
.overdue-warning { color: #ef4444; font-weight: 700; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: .5; } 100% { opacity: 1; } }
.filter-group { display: flex; gap: 8px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.filter-chip { flex: 1; padding: 12px; text-align: center; white-space: nowrap; background: var(--input-bg); border: var(--glass-border); border-radius: 14px; font-size: .85rem; font-weight: 600; color: var(--text-sub); cursor: pointer; transition: .3s; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 90px; background: var(--nav-bg); border-top: var(--glass-border); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; justify-content: space-around; align-items: flex-start; padding-top: 15px; z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; background: 0 0; border: none; color: var(--text-sub); font-size: .65rem; transition: .3s; opacity: .7; flex: 1; }
.nav-item i { font-size: 1.4rem; margin-bottom: 5px; }
.nav-item.active { color: var(--primary); opacity: 1; transform: translateY(-3px); }
.sort-btn { background: 0 0; border: 1px solid var(--text-sub); color: var(--text-sub); border-radius: 12px; padding: 5px 10px; font-size: .8rem; cursor: pointer; }
#loader { display: none; margin-top: 15px; font-weight: 600; color: var(--primary); }
.overlay-bg { position: fixed; inset: 0; z-index: 9999; background: var(--bg-image); display: flex; justify-content: center; align-items: center; overflow-y: auto; padding: 20px; }
.modal-card { background: var(--glass-bg); backdrop-filter: blur(30px); padding: 30px; border-radius: 24px; border: 1px solid var(--glass-border); width: 100%; max-width: 500px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); animation: popUp .3s cubic-bezier(0.18, 0.89, 0.32, 1.28); margin: auto; }
@keyframes popUp { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rating-btn-group { display: flex; justify-content: center; gap: 10px; margin: 15px 0; }
.rating-btn { width: 40px; height: 40px; border-radius: 50%; border: var(--glass-border); background: rgba(255, 255, 255, 0.1); font-size: 1rem; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; transition: .2s; }
.rating-btn.selected, .rating-btn:hover { background: #f59e0b; color: #fff; transform: scale(1.1); border-color: #f59e0b; }
.card-question { font-size: .85rem; color: var(--primary); font-style: italic; margin: 10px 0; min-height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(59, 130, 246, 0.1); padding: 10px; border-radius: 12px; }
.mic-btn { position: absolute; right: 10px; bottom: 10px; background: var(--primary); color: #fff; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .3s; }
.mic-btn.listening { background: #ef4444; animation: pulseMic 1s infinite; }
@keyframes pulseMic { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.edit-input { padding: 8px; border-radius: 8px; border: 1px solid #ccc; width: 100%; font-size: .9rem; margin-bottom: 5px; }
.setting-label { font-size: .85rem; font-weight: 600; color: var(--text-sub); margin-bottom: 5px; display: block; text-align: left; }
.setting-row { display: flex; gap: 10px; margin-bottom: 10px; }
.setting-row input { flex: 1; text-align: center; }
.divider-text { display: flex; align-items: center; text-align: center; color: var(--text-sub); font-size: .8rem; margin: 15px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-bottom: 1px solid var(--glass-border); }
.divider-text:not(:empty)::before { margin-right: .25em; }
.divider-text:not(:empty)::after { margin-left: .25em; }
.tree-wrapper { position: relative; width: 100%; height: 500px; background: linear-gradient(to bottom, #87CEEB 0%, #E0F7FA 100%); border-radius: 24px; overflow: hidden; margin-top: 10px; border: var(--glass-border); }
body.dark-mode .tree-wrapper { background: linear-gradient(to bottom, #0f172a 0%, #1e293b 100%); }
.tree-svg-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.tree-fruit { position: absolute; font-size: 2.2rem; cursor: pointer; transition: all 0.3s; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3)); z-index: 10; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
.tree-fruit:hover { transform: scale(1.3) rotate(15deg); z-index: 20; }
.fruit-detail-modal { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 90%; background: rgba(255, 255, 255, 0.95); border-radius: 16px; padding: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); text-align: center; display: none; z-index: 30; color: #1d1d1f; border: 1px solid rgba(0, 0, 0, 0.1); animation: slideUp 0.3s ease; }
body.dark-mode .fruit-detail-modal { background: rgba(30, 41, 59, 0.95); color: white; border-color: rgba(255, 255, 255, 0.1); }
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.all-reviews-list { margin-top: 20px; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--glass-border); padding-top: 15px; }
.review-card { background: var(--input-bg); border: var(--glass-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 5px; }
.rc-header { display: flex; justify-content: space-between; font-weight: bold; font-size: 0.9rem; color: var(--primary); }
.rc-badge { font-size: .75rem; background: rgba(59, 130, 246, 0.1); color: var(--primary); padding: 2px 8px; border-radius: 12px; align-self: flex-start; }
.rc-text { font-style: italic; font-size: .9rem; color: var(--text-main); line-height: 1.4; }
.close-overlay-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.8rem; color: var(--text-main); cursor: pointer; z-index: 50; }
.journey-container { position: relative; width: 100%; height: 550px; background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%); border-radius: 20px; overflow: hidden; margin-top: 20px; border: 2px solid rgba(255, 255, 255, 0.2); }
.stars { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1231630/stars.png'); opacity: 0.6; }
.svg-path { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.station-node { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.4); transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; z-index: 5; backdrop-filter: blur(5px); box-shadow: 0 0 15px rgba(0, 0, 0, 0.5); }
.station-node.active { background: #3b82f6; border-color: white; box-shadow: 0 0 25px #3b82f6; }
.station-label { position: absolute; top: 110%; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6); padding: 2px 6px; border-radius: 4px; font-size: .7rem; white-space: nowrap; color: #fff; text-align: center; }
.astronaut { position: absolute; font-size: 2.5rem; transform: translate(-50%, -50%); z-index: 10; transition: all 1.5s cubic-bezier(0.34, 1.56, 0.64, 1); filter: drop-shadow(0 0 10px gold); animation: floatAstro 3s ease-in-out infinite; }
@keyframes floatAstro { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -65%); } }
.login-tabs { display: flex; margin-bottom: 15px; border-radius: 14px; overflow: hidden; border: var(--glass-border); }
.login-tab { flex: 1; padding: 12px; background: var(--input-bg); border: none; color: var(--text-sub); font-weight: 600; cursor: pointer; }
.login-tab.active { background: var(--primary); color: white; }
