diff --git a/index.html b/index.html index 767d617..3cde4b4 100644 --- a/index.html +++ b/index.html @@ -10,9 +10,6 @@ --color-primary-hover: #4096FF; --color-primary-active: #0958D9; --color-primary-bg: #E6F4FF; - --color-success: #52C41A; - --color-warning: #FAAD14; - --color-error: #FF4D4F; --bg: #F5F5F5; --bg-container: #FFFFFF; --bg-elevated: #FAFAFA; @@ -30,55 +27,46 @@ --sidebar-w: 260px; --drawer-bg: #FFFFFF; } - -/* ===== Dark Mode ===== */ [data-theme="dark"] { --color-primary: #177DDC; --color-primary-hover: #4096FF; --color-primary-active: #0958D9; --color-primary-bg: rgba(23,125,220,0.15); - --bg: #0A0A0A; - --bg-container: #141414; - --bg-elevated: #1A1A1A; - --border: #303030; - --border-light: #222222; - --text-primary: #E8E8E8; - --text-secondary: #A6A6A6; - --text-tertiary: #6E6E6E; - --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 1px 6px -1px rgba(0,0,0,0.15); - --shadow-md: 0 2px 4px rgba(0,0,0,0.25), 0 4px 12px -2px rgba(0,0,0,0.2); - --drawer-bg: #141414; + --bg: #111111; + --bg-container: #1C1C1E; + --bg-elevated: #242426; + --border: #3A3A3C; + --border-light: #2C2C2E; + --text-primary: #D1D1D6; + --text-secondary: #8E8E93; + --text-tertiary: #636366; + --shadow-sm: 0 1px 2px rgba(0,0,0,0.15), 0 1px 4px -1px rgba(0,0,0,0.1); + --shadow-md: 0 2px 4px rgba(0,0,0,0.2), 0 4px 10px -2px rgba(0,0,0,0.15); + --drawer-bg: #1C1C1E; } - * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; - background: var(--bg); - color: var(--text-primary); - line-height: 1.57; - font-size: 14px; - min-height: 100vh; + background: var(--bg); color: var(--text-primary); + line-height: 1.57; font-size: 14px; min-height: 100vh; -webkit-tap-highlight-color: transparent; transition: background 0.2s ease, color 0.2s ease; } - -/* ===== Header ===== */ .header-bar { position: sticky; top: 0; height: var(--header-h); - background: rgba(255,255,255,0.95); - backdrop-filter: blur(12px); + background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); - display: flex; align-items: center; padding: 0 16px; z-index: 100; gap: 12px; + display: flex; align-items: center; justify-content: center; padding: 0 16px; z-index: 100; gap: 16px; } [data-theme="dark"] .header-bar { background: rgba(20,20,20,0.95); } -.header-bar .theme-btn { +.header-bar .menu-btn { width: 36px; height: 36px; border: none; background: none; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; - font-size: 16px; color: var(--text-secondary); - flex-shrink: 0; margin-left: 4px; + flex-shrink: 0; padding: 0; } -.header-bar .theme-btn:hover { background: var(--bg-elevated); } +.header-bar .menu-btn:hover { background: var(--bg-elevated); } +.header-bar .menu-btn svg { width: 20px; height: 20px; color: var(--text-secondary); } .header-bar .brand { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; } .header-bar h1 { font-size: 15px; font-weight: 700; @@ -86,26 +74,20 @@ body { -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .header-bar .tagline { font-size: 11px; color: var(--text-tertiary); display: inline; } -.header-bar .search-box { flex: 0 1 300px; min-width: 100px; position: relative; } +.search-box { flex: 1; min-width: 80px; position: relative; } .search-box input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); - font-size: 14px; outline: none; background: var(--bg-elevated); - color: var(--text-primary); + font-size: 14px; outline: none; background: var(--bg-elevated); color: var(--text-primary); transition: border-color 0.15s ease, box-shadow 0.15s ease; - min-width: 0; } .search-box input::placeholder { color: var(--text-tertiary); } .search-box input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-bg); background: var(--bg-container); } -.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 15px; pointer-events: none; line-height: 1; } +.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 15px; pointer-events: none; } -/* ===== Filter Chips (mobile) ===== */ .chip-bar { - display: none; - padding: 10px 16px 0; - background: var(--bg-container); - border-bottom: 1px solid var(--border-light); - position: sticky; top: var(--header-h); z-index: 90; + display: none; padding: 10px 16px 0; background: var(--bg-container); + border-bottom: 1px solid var(--border-light); position: sticky; top: var(--header-h); z-index: 90; } .chip-bar-inner { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; @@ -114,25 +96,17 @@ body { .chip-bar-inner::-webkit-scrollbar { display: none; } .chip { display: inline-flex; align-items: center; gap: 5px; - padding: 7px 14px; border-radius: 20px; - font-size: 13px; font-weight: 500; white-space: nowrap; - border: 1px solid var(--border); background: var(--bg-container); - color: var(--text-secondary); cursor: pointer; - transition: all 0.15s ease; user-select: none; - -webkit-tap-highlight-color: transparent; - min-height: 36px; + padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; white-space: nowrap; + border: 1px solid var(--border); background: var(--bg-container); color: var(--text-secondary); + cursor: pointer; transition: all 0.15s ease; user-select: none; + -webkit-tap-highlight-color: transparent; min-height: 36px; } .chip:active { transform: scale(0.96); } .chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; } -.chip .chip-count { - font-size: 11px; background: rgba(0,0,0,0.08); border-radius: 10px; padding: 0 5px; line-height: 1.5; -} +.chip .chip-count { font-size: 11px; background: rgba(0,0,0,0.08); border-radius: 10px; padding: 0 5px; } .chip.active .chip-count { background: rgba(255,255,255,0.25); } -/* ===== Layout ===== */ .layout { display: flex; max-width: 1200px; margin: 0 auto; min-height: calc(100vh - var(--header-h)); } - -/* ===== Sidebar ===== */ .sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-container); border-right: 1px solid var(--border-light); padding: 16px 0; @@ -144,25 +118,32 @@ body { letter-spacing: 0.5px; margin-bottom: 4px; padding: 4px 0; } .sidebar .nav-item { - display: flex; align-items: center; gap: 8px; - padding: 8px 12px; border-radius: var(--radius-sm); - font-size: 13px; color: var(--text-secondary); - cursor: pointer; transition: all 0.12s ease; text-decoration: none; - min-height: 40px; + display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); + font-size: 13px; color: var(--text-secondary); cursor: pointer; + transition: all 0.12s ease; text-decoration: none; min-height: 40px; } .sidebar .nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); } .sidebar .nav-item.active { background: var(--color-primary-bg); color: var(--color-primary); font-weight: 500; } .sidebar .nav-item .nav-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; } .sidebar .nav-item .nav-count { margin-left: auto; font-size: 11px; color: var(--text-tertiary); - background: var(--bg-elevated); border-radius: 10px; padding: 0 6px; line-height: 1.6; + background: var(--bg-elevated); border-radius: 10px; padding: 0 6px; } .sidebar .nav-item.active .nav-count { background: rgba(22,119,255,0.12); color: var(--color-primary); } .sidebar .sub-nav { padding-left: 24px; overflow: hidden; max-height: 0; transition: max-height 0.25s ease; } .sidebar .sub-nav.open { max-height: 500px; } .sidebar .sub-nav .nav-item { font-size: 12px; padding: 5px 12px; } +.sidebar .theme-section { + padding: 12px 16px; border-top: 1px solid var(--border-light); margin-top: 8px; +} +.sidebar .theme-toggle-btn { + display: flex; align-items: center; gap: 8px; width: 100%; + padding: 8px 12px; border: none; background: none; cursor: pointer; + border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); + min-height: 40px; +} +.sidebar .theme-toggle-btn:hover { background: var(--bg-elevated); color: var(--text-primary); } -/* ===== Drawer Overlay ===== */ .drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200; opacity: 0; transition: opacity 0.2s ease; @@ -171,8 +152,7 @@ body { .drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw; background: var(--drawer-bg); z-index: 201; - transform: translateX(-100%); transition: transform 0.25s ease; - overflow-y: auto; + transform: translateX(-100%); transition: transform 0.25s ease; overflow-y: auto; } .drawer-overlay.show .drawer { transform: translateX(0); } .drawer-header { @@ -184,8 +164,14 @@ body { border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-secondary); } +.drawer .theme-toggle-btn { + display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 12px 16px; + padding: 8px 12px; border: 1px solid var(--border); background: var(--bg-elevated); + cursor: pointer; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); + min-height: 40px; +} +.drawer .theme-toggle-btn:hover { background: var(--color-primary-bg); color: var(--color-primary); } -/* ===== Main ===== */ .main { flex: 1; padding: 24px 32px 64px; min-width: 0; } .breadcrumb { font-size: 12px; color: var(--text-tertiary); margin-bottom: 12px; } .breadcrumb a { color: var(--text-tertiary); text-decoration: none; } @@ -193,9 +179,8 @@ body { .breadcrumb .sep { margin: 0 4px; } .stats-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; } .stat-item { - display: flex; align-items: baseline; gap: 4px; - padding: 8px 14px; background: var(--bg-container); - border: 1px solid var(--border-light); border-radius: var(--radius-sm); + display: flex; align-items: baseline; gap: 4px; padding: 8px 14px; + background: var(--bg-container); border: 1px solid var(--border-light); border-radius: var(--radius-sm); } .stat-num { font-size: 18px; font-weight: 700; color: var(--color-primary); } .stat-label { font-size: 12px; color: var(--text-tertiary); } @@ -225,8 +210,7 @@ body { .wiki-toc-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-light); - cursor: pointer; user-select: none; transition: background 0.12s ease; - min-height: 44px; + cursor: pointer; user-select: none; transition: background 0.12s ease; min-height: 44px; } .wiki-toc-header:hover { background: var(--color-primary-bg); } .wiki-toc-header .toc-icon { font-size: 16px; transition: transform 0.2s ease; } @@ -236,10 +220,9 @@ body { .wiki-toc-body { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; } .wiki-toc-body.open { max-height: 2000px; } .wiki-toc-item { - display: flex; align-items: center; gap: 10px; - padding: 12px 18px 12px 42px; border-bottom: 1px solid var(--border-light); - transition: background 0.1s ease; text-decoration: none; color: var(--text-primary); - min-height: 48px; + display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 42px; + border-bottom: 1px solid var(--border-light); transition: background 0.1s ease; + text-decoration: none; color: var(--text-primary); min-height: 48px; } .wiki-toc-item:last-child { border-bottom: none; } .wiki-toc-item:active { background: var(--color-primary-bg); } @@ -250,18 +233,11 @@ body { background: var(--bg-elevated); color: var(--text-tertiary); flex-shrink: 0; } -/* ===== Desktop only ===== */ -@media (min-width: 769px) { - .chip-bar { display: none !important; } - .header-bar .menu-btn { display: none; } -} - -/* ===== Mobile ===== */ +@media (min-width: 769px) { .chip-bar { display: none !important; } } @media (max-width: 768px) { .header-bar { padding: 0 10px; gap: 8px; } - .menu-btn { display: flex !important; } .header-bar .tagline { display: none; } - .search-box input { padding: 7px 10px 7px 30px; font-size: 14px; } + .search-box input { padding: 7px 10px 7px 30px; } .search-box .search-icon { left: 8px; font-size: 14px; } .chip-bar { display: block; } .sidebar { display: none; } @@ -274,7 +250,6 @@ body { .wiki-section-title { font-size: 16px; } .wiki-toc-item { padding: 10px 14px 10px 36px; } .wiki-toc-header { padding: 12px 14px; } - .header-bar .theme-btn { width: 32px; height: 32px; font-size: 15px; } } @@ -292,15 +267,10 @@ body { - - -
+ - @@ -317,102 +288,70 @@ body { -