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

        /* ---------- CSS CUSTOM PROPERTIES (THEME READY) ---------- */
        :root {
            --bg-body: #faf7f0;
            --surface-card: #ffffff;
            --text-primary: #2c2b28;
            --text-secondary: #4a4a48;
            --border-light: #e2dfd7;
            --header-bg: #2c3e50;
            --header-text: #f0f2f5;
            --accent: #3b7cbf;
            --accent-hover: #2c5f8a;
            --success: #2c7a4d;
            --danger: #c23b22;
            --sidebar-bg: #fffef7;
            --sidebar-border: #ddd8cc;
            --progress-bar: #d4af37;
            --paper-shadow: 0 20px 35px -12px rgba(0,0,0,0.1);
            --footer-bg: #1e2a36;
            --code-fallback: #f4f1ea;
            --transition-default: all 0.25s ease;
            --popup-bg: #fff3e0;
            --accent-gold: #c9a03d;
        }

        body.dark {
            --bg-body: #1a1c1e;
            --surface-card: #25282c;
            --text-primary: #e8edf2;
            --text-secondary: #b9c2cc;
            --border-light: #3a3f44;
            --header-bg: #0f1217;
            --header-text: #e0e6ed;
            --accent: #5a9bd5;
            --accent-hover: #7bb3e0;
            --sidebar-bg: #202327;
            --sidebar-border: #2f3338;
            --paper-shadow: 0 20px 35px -12px rgba(0,0,0,0.5);
            --footer-bg: #0b0e12;
            --code-fallback: #2d2f33;
            --popup-bg: #2d2f33;
            --accent-gold: #e6c87b;
        }

        body {
            background: var(--bg-body);
            color: var(--text-primary);
            font-family: 'Segoe UI', 'Georgia', 'Times New Roman', serif;
            line-height: 1.65;
            transition: background 0.2s, color 0.2s;
            scroll-behavior: smooth;
        }

        /* Typography refinement */
        .reed-content {
            font-size: 1.1rem;
            max-width: 880px;
            margin: 0 auto;
            font-weight: 400;
        }

        .reed-content p {
            margin-bottom: 1.4rem;
            text-align: justify;
            letter-spacing: 0.01em;
        }

        .reed-content h1 {
            font-size: 2.6rem;
            margin: 1.8rem 0 0.5rem;
            text-align: center;
            font-weight: 600;
            letter-spacing: -0.3px;
            border-bottom: 2px solid var(--border-light);
            display: inline-block;
            width: auto;
            padding-bottom: 0.5rem;
        }

        .reed-content h2 {
            font-size: 1.9rem;
            margin: 2rem 0 1rem;
            font-weight: 500;
            color: var(--accent);
            border-left: 4px solid var(--accent);
            padding-left: 1rem;
        }

        .reed-content h3 {
            font-size: 1.5rem;
            margin: 1.5rem 0 0.8rem;
            font-weight: 500;
        }

        .reed-content .contents {
            background: var(--surface-card);
            padding: 1.2rem 2rem;
            border-radius: 28px;
            box-shadow: var(--paper-shadow);
            margin: 2rem 0;
            border: 1px solid var(--border-light);
        }

        .contents ol {
            columns: 2;
            column-gap: 2rem;
            list-style-position: inside;
        }

        .contents li {
            margin: 0.4rem 0;
            break-inside: avoid;
        }

        .contents a {
            text-decoration: none;
            color: var(--accent);
            font-weight: 500;
            transition: var(--transition-default);
        }

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

        /* Header & navigation modern */
        .glass-header {
            background: var(--header-bg);
            backdrop-filter: blur(0px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            position: sticky;
            top: 0;
            z-index: 1100;
        }

        .top-nav {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0.8rem 1.5rem;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .logo {
            font-size: 1.6rem;
            font-weight: 700;
            color: white;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .nav-links-main {
            display: flex;
            gap: 1.2rem;
            flex-wrap: wrap;
        }

        .nav-links-main a {
            color: #eef2f5;
            text-decoration: none;
            font-weight: 500;
            padding: 0.4rem 0;
            transition: 0.2s;
            border-bottom: 2px solid transparent;
        }

        .nav-links-main a:hover {
            border-bottom-color: var(--accent);
            color: white;
        }

        .toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            background: rgba(255,255,255,0.08);
            padding: 0.4rem 0.8rem;
            border-radius: 60px;
            align-items: center;
        }

        .toolbar button, .mode-controls button, .echo-core button {
            background: rgba(255,255,255,0.15);
            border: none;
            color: white;
            padding: 0.4rem 0.9rem;
            border-radius: 40px;
            font-weight: 500;
            cursor: pointer;
            transition: 0.2s;
            font-size: 0.85rem;
        }

        .toolbar button:hover, .mode-controls button:hover, .echo-core button:hover {
            background: var(--accent);
            transform: scale(0.97);
        }

        .main-toggle.active {
            background: #4caf50;
            box-shadow: 0 0 8px #4caf50aa;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        /* Reading progress */
        .reading-progress {
            height: 4px;
            background: #d9d9d9;
            width: 100%;
        }

        .progress-bar {
            height: 4px;
            background: var(--progress-bar);
            width: 0%;
            transition: width 0.1s linear;
        }

        /* Sidebar elegant */
        .sidebar {
            position: fixed;
            left: -300px;
            top: 0;
            width: 300px;
            height: 100%;
            background: var(--sidebar-bg);
            box-shadow: 4px 0 25px rgba(0,0,0,0.2);
            z-index: 1300;
            transition: left 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
            padding: 1.5rem;
            overflow-y: auto;
            border-right: 1px solid var(--sidebar-border);
        }

        .sidebar.open {
            left: 0;
        }

        .sidebar-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(3px);
            z-index: 1200;
            opacity: 0;
            visibility: hidden;
            transition: 0.2s;
        }

        .sidebar-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .menu-toggle-btn {
            position: fixed;
            bottom: 24px;
            left: 20px;
            background: var(--accent);
            border: none;
            color: white;
            width: 48px;
            height: 48px;
            border-radius: 60px;
            font-size: 1.8rem;
            cursor: pointer;
            z-index: 1150;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            transition: 0.2s;
        }

        .nav-item {
            padding: 0.7rem 0.5rem;
            margin: 0.3rem 0;
            border-radius: 40px;
            cursor: pointer;
            transition: 0.1s;
            display: flex;
            gap: 12px;
            align-items: center;
            font-weight: 500;
        }

        .nav-item:hover {
            background: var(--accent);
            color: white;
            transform: translateX(5px);
        }

        /* Bookmarks panel right */
        .bookmarks-panel {
            position: fixed;
            right: -320px;
            top: 80px;
            width: 300px;
            background: var(--surface-card);
            border-radius: 24px 0 0 24px;
            box-shadow: -5px 8px 25px rgba(0,0,0,0.15);
            z-index: 1050;
            transition: right 0.3s ease;
            border: 1px solid var(--border-light);
            backdrop-filter: blur(4px);
        }

        .bookmarks-panel.open {
            right: 0;
        }

        .panel-header {
            padding: 1rem;
            background: var(--accent);
            color: white;
            border-radius: 24px 0 0 0;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            font-weight: bold;
        }

        .bookmarks-list {
            max-height: 400px;
            overflow-y: auto;
            padding: 0.5rem;
        }

        .bookmark-item {
            background: var(--bg-body);
            margin: 0.6rem 0;
            padding: 0.7rem;
            border-radius: 20px;
            cursor: pointer;
            transition: 0.1s;
            border-left: 3px solid var(--accent);
        }

        .bookmark-title {
            display: flex;
            justify-content: space-between;
            font-weight: bold;
        }

        .delete-bookmark {
            background: none;
            border: none;
            color: var(--danger);
            font-weight: bold;
            cursor: pointer;
        }

        /* Dictionary Popup Styles */
        .dict-popup {
            position: absolute;
            background: var(--popup-bg);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 12px 16px;
            max-width: 320px;
            min-width: 200px;
            z-index: 10000;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
            font-size: 0.9rem;
            backdrop-filter: blur(8px);
            animation: fadeIn 0.15s ease-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .dict-popup .close-btn {
            position: absolute;
            top: 8px;
            right: 12px;
            font-size: 1.2rem;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .dict-popup .close-btn:hover { opacity: 1; }
        
        .dict-popup .word {
            font-weight: bold;
            font-size: 1.1rem;
            margin-bottom: 6px;
            padding-right: 20px;
        }

        /* Reed paper effect */
        .book-container {
            max-width: 1100px;
            margin: 2rem auto;
            padding: 0 1.5rem;
        }

        .reed-paper {
            background: var(--surface-card);
            border-radius: 32px;
            box-shadow: var(--paper-shadow);
            padding: 2rem 1.8rem;
            transition: background 0.2s;
        }

        /* Image placeholder */
        .image-placeholder {
            background: var(--code-fallback);
            padding: 1rem;
            text-align: center;
            border-radius: 24px;
            margin: 1.5rem 0;
            font-style: italic;
            color: var(--text-secondary);
        }

        /* Footer modern */
        footer {
            background: var(--footer-bg);
            color: #cddde9;
            margin-top: 4rem;
            padding: 2.5rem 1.5rem 1.5rem;
        }

        .footer-container {
            max-width: 1200px;
            margin: auto;
            display: flex;
            flex-wrap: wrap;
            gap: 2rem;
            justify-content: space-between;
        }

        .footer-section a, .footer-section p {
            color: #b9cddf;
        }

        /* highlight animation */
        .highlight-temp {
            background: #ffecb3;
            transition: background 0.3s;
            border-radius: 8px;
        }
        body.dark .highlight-temp {
            background: #5e4b2b;
        }

        /* Recording indicator */
        .recording-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #f44336;
            margin-right: 8px;
            animation: pulse-red 1s infinite;
        }
        
        @keyframes pulse-red {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(1.2); }
        }

        @media (max-width: 780px) {
            .top-nav { flex-direction: column; align-items: stretch; }
            .toolbar { justify-content: center; }
            .reed-content h1 { font-size: 2rem; }
            .contents ol { columns: 1; }
            .menu-toggle-btn { bottom: 18px; left: 18px; width: 44px; height: 44px; }
        }
        button:active { transform: scale(0.96); }
        .echo-core .main-toggle { background: #ff7043; color: white; font-weight: bold; }