style.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
  2. /* CSS Variables for Theme Support */
  3. :root {
  4. --bg-primary: #fafafa;
  5. --bg-secondary: white;
  6. --bg-tertiary: #f5f5f5;
  7. --text-primary: #333;
  8. --text-secondary: #666;
  9. --text-tertiary: #999;
  10. --border-primary: #e0e0e0;
  11. --border-secondary: #ddd;
  12. --accent-primary: #007bff;
  13. --accent-primary-hover: #0056b3;
  14. --accent-secondary: #6c757d;
  15. --overlay-bg: rgba(0,0,0,0.5);
  16. --shadow: rgba(0,0,0,0.3);
  17. }
  18. /* Dark Theme Variables */
  19. [data-theme="dark"] {
  20. --bg-primary: #1a1a1a;
  21. --bg-secondary: #2d2d2d;
  22. --bg-tertiary: #404040;
  23. --text-primary: #e0e0e0;
  24. --text-secondary: #b0b0b0;
  25. --text-tertiary: #808080;
  26. --border-primary: #404040;
  27. --border-secondary: #555;
  28. --accent-primary: #4dabf7;
  29. --accent-primary-hover: #339af0;
  30. --accent-secondary: #868e96;
  31. --overlay-bg: rgba(0,0,0,0.7);
  32. --shadow: rgba(0,0,0,0.5);
  33. }
  34. * {
  35. margin: 0;
  36. padding: 0;
  37. box-sizing: border-box;
  38. }
  39. body {
  40. font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  41. background-color: var(--bg-primary);
  42. color: var(--text-primary);
  43. height: 100vh;
  44. height: calc(var(--vh, 1vh) * 100); /* Fallback for mobile browsers */
  45. display: flex;
  46. flex-direction: column;
  47. transition: background-color 0.3s ease, color 0.3s ease;
  48. overflow-x: hidden;
  49. }
  50. .header {
  51. background: var(--bg-secondary);
  52. border-bottom: 1px solid var(--border-primary);
  53. padding: 15px 20px;
  54. display: flex;
  55. justify-content: space-between;
  56. align-items: center;
  57. min-height: 60px;
  58. transition: background-color 0.3s ease, border-color 0.3s ease;
  59. }
  60. .title {
  61. font-size: 18px;
  62. color: var(--text-primary);
  63. font-weight: 500;
  64. display: flex;
  65. align-items: center;
  66. gap: 8px;
  67. }
  68. .title img {
  69. height: 28px;
  70. width: 28px;
  71. border-radius: 6px;
  72. vertical-align: middle;
  73. flex-shrink: 0;
  74. object-fit: contain;
  75. background: var(--bg-tertiary);
  76. transition: all 0.3s ease;
  77. }
  78. /* Fallback when logo fails to load */
  79. .title img[alt]:empty::before,
  80. .title img[alt]:not([src])::before {
  81. content: "📝";
  82. display: block;
  83. font-size: 16px;
  84. text-align: center;
  85. line-height: 28px;
  86. }
  87. .note-id {
  88. font-family: monospace;
  89. font-size: 12px;
  90. color: var(--text-secondary);
  91. background: var(--bg-tertiary);
  92. padding: 4px 8px;
  93. border-radius: 3px;
  94. }
  95. .header-right {
  96. display: flex;
  97. align-items: center;
  98. gap: 10px;
  99. }
  100. .new-btn {
  101. background: var(--accent-primary);
  102. color: white;
  103. border: none;
  104. padding: 8px 16px;
  105. border-radius: 4px;
  106. cursor: pointer;
  107. font-size: 14px;
  108. transition: background-color 0.2s ease;
  109. }
  110. .new-btn:hover {
  111. background: var(--accent-primary-hover);
  112. }
  113. .content {
  114. flex: 1;
  115. display: flex;
  116. }
  117. .note-area {
  118. flex: 1;
  119. border: none;
  120. outline: none;
  121. padding: 30px;
  122. font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  123. font-size: 16px;
  124. line-height: 1.6;
  125. resize: none;
  126. background: var(--bg-secondary);
  127. color: var(--text-primary);
  128. transition: background-color 0.3s ease, color 0.3s ease;
  129. }
  130. .note-area::placeholder {
  131. color: var(--text-tertiary);
  132. }
  133. .id-input-overlay {
  134. position: fixed;
  135. top: 0;
  136. left: 0;
  137. right: 0;
  138. bottom: 0;
  139. background: var(--overlay-bg);
  140. display: flex;
  141. justify-content: center;
  142. align-items: center;
  143. z-index: 1000;
  144. }
  145. .id-input-dialog {
  146. background: var(--bg-secondary);
  147. padding: 30px;
  148. border-radius: 8px;
  149. box-shadow: 0 4px 20px var(--shadow);
  150. max-width: 400px;
  151. width: 90%;
  152. transition: background-color 0.3s ease;
  153. }
  154. .id-input-dialog h3 {
  155. margin-bottom: 15px;
  156. color: var(--text-primary);
  157. }
  158. .id-input {
  159. width: 100%;
  160. padding: 12px;
  161. border: 1px solid var(--border-secondary);
  162. border-radius: 4px;
  163. font-size: 14px;
  164. margin-bottom: 15px;
  165. background: var(--bg-secondary);
  166. color: var(--text-primary);
  167. transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  168. }
  169. .dialog-buttons {
  170. display: flex;
  171. gap: 10px;
  172. justify-content: flex-end;
  173. }
  174. .dialog-btn {
  175. padding: 8px 16px;
  176. border: none;
  177. border-radius: 4px;
  178. cursor: pointer;
  179. font-size: 14px;
  180. transition: background-color 0.2s ease;
  181. }
  182. .dialog-btn.primary {
  183. background: var(--accent-primary);
  184. color: white;
  185. }
  186. .dialog-btn.primary:hover {
  187. background: var(--accent-primary-hover);
  188. }
  189. .dialog-btn.secondary {
  190. background: var(--accent-secondary);
  191. color: white;
  192. }
  193. .dialog-btn.secondary:hover {
  194. opacity: 0.9;
  195. }
  196. /* Theme Switch Styles */
  197. .theme-switch {
  198. background: var(--bg-tertiary);
  199. border: 1px solid var(--border-primary);
  200. border-radius: 20px;
  201. padding: 4px;
  202. cursor: pointer;
  203. width: 44px;
  204. height: 24px;
  205. position: relative;
  206. transition: all 0.3s ease;
  207. display: flex;
  208. align-items: center;
  209. }
  210. .theme-switch:hover {
  211. background: var(--border-primary);
  212. }
  213. .theme-switch::before {
  214. content: '';
  215. width: 16px;
  216. height: 16px;
  217. border-radius: 50%;
  218. background: var(--accent-primary);
  219. position: absolute;
  220. left: 4px;
  221. transition: all 0.3s ease;
  222. box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  223. }
  224. .theme-switch.dark::before {
  225. transform: translateX(20px);
  226. }
  227. .hidden {
  228. display: none;
  229. }
  230. /* Mobile-First Responsive Design */
  231. /* Base styles are already mobile-friendly, now add tablet and desktop improvements */
  232. /* Small smartphones (portrait) */
  233. @media screen and (max-width: 480px) {
  234. .header {
  235. padding: 12px 15px;
  236. min-height: 56px;
  237. flex-wrap: nowrap;
  238. }
  239. .title {
  240. font-size: 16px;
  241. font-weight: 600;
  242. gap: 6px;
  243. }
  244. .title img {
  245. height: 24px;
  246. width: 24px;
  247. border-radius: 4px;
  248. }
  249. .header-right {
  250. gap: 8px;
  251. flex-shrink: 0;
  252. }
  253. .note-id {
  254. font-size: 10px;
  255. padding: 3px 6px;
  256. max-width: 80px;
  257. overflow: hidden;
  258. text-overflow: ellipsis;
  259. white-space: nowrap;
  260. }
  261. /* Make theme switch more touch-friendly */
  262. .theme-switch {
  263. width: 48px;
  264. height: 28px;
  265. padding: 6px;
  266. min-width: 48px;
  267. min-height: 48px;
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. }
  272. .theme-switch::before {
  273. width: 18px;
  274. height: 18px;
  275. left: 6px;
  276. }
  277. .theme-switch.dark::before {
  278. transform: translateX(18px);
  279. }
  280. /* Touch-friendly buttons */
  281. .new-btn {
  282. padding: 10px 14px;
  283. font-size: 13px;
  284. min-height: 44px;
  285. touch-action: manipulation;
  286. -webkit-tap-highlight-color: transparent;
  287. }
  288. /* Optimize text area for mobile */
  289. .note-area {
  290. padding: 20px 15px;
  291. font-size: 16px; /* Prevents zoom on iOS */
  292. line-height: 1.5;
  293. -webkit-appearance: none;
  294. border-radius: 0;
  295. }
  296. /* Mobile-optimized modal */
  297. .id-input-overlay {
  298. padding: 20px 15px;
  299. align-items: flex-start;
  300. padding-top: 25vh;
  301. }
  302. .id-input-dialog {
  303. padding: 24px 20px;
  304. margin: 0;
  305. border-radius: 12px;
  306. width: 100%;
  307. max-width: 320px;
  308. }
  309. .id-input-dialog h3 {
  310. font-size: 18px;
  311. margin-bottom: 16px;
  312. }
  313. .id-input {
  314. padding: 14px 12px;
  315. font-size: 16px; /* Prevents zoom on iOS */
  316. border-radius: 8px;
  317. margin-bottom: 20px;
  318. -webkit-appearance: none;
  319. }
  320. .dialog-buttons {
  321. gap: 12px;
  322. flex-direction: row;
  323. }
  324. .dialog-btn {
  325. flex: 1;
  326. padding: 12px 16px;
  327. font-size: 14px;
  328. font-weight: 500;
  329. min-height: 44px;
  330. border-radius: 8px;
  331. touch-action: manipulation;
  332. -webkit-tap-highlight-color: transparent;
  333. }
  334. }
  335. /* Larger smartphones and small tablets (landscape phones) */
  336. @media screen and (min-width: 481px) and (max-width: 768px) {
  337. .header {
  338. padding: 15px 20px;
  339. }
  340. .title {
  341. font-size: 18px;
  342. gap: 7px;
  343. }
  344. .title img {
  345. height: 26px;
  346. width: 26px;
  347. border-radius: 5px;
  348. }
  349. .note-area {
  350. padding: 25px 20px;
  351. font-size: 16px;
  352. }
  353. .id-input-dialog {
  354. max-width: 400px;
  355. padding: 28px 24px;
  356. }
  357. .theme-switch {
  358. width: 46px;
  359. height: 26px;
  360. }
  361. .theme-switch::before {
  362. width: 17px;
  363. height: 17px;
  364. left: 5px;
  365. }
  366. .theme-switch.dark::before {
  367. transform: translateX(19px);
  368. }
  369. }
  370. /* Tablets and small desktops */
  371. @media screen and (min-width: 769px) and (max-width: 1024px) {
  372. .header {
  373. padding: 16px 24px;
  374. min-height: 64px;
  375. }
  376. .title {
  377. font-size: 20px;
  378. gap: 8px;
  379. }
  380. .title img {
  381. height: 28px;
  382. width: 28px;
  383. border-radius: 6px;
  384. }
  385. .note-area {
  386. padding: 32px 28px;
  387. font-size: 17px;
  388. }
  389. .new-btn {
  390. padding: 10px 18px;
  391. font-size: 15px;
  392. }
  393. }
  394. /* Large screens and desktops */
  395. @media screen and (min-width: 1025px) {
  396. .header {
  397. padding: 18px 32px;
  398. min-height: 68px;
  399. }
  400. .title {
  401. font-size: 22px;
  402. gap: 10px;
  403. }
  404. .title img {
  405. height: 32px;
  406. width: 32px;
  407. border-radius: 7px;
  408. }
  409. .note-area {
  410. padding: 40px 36px;
  411. font-size: 18px;
  412. }
  413. .id-input-dialog {
  414. max-width: 480px;
  415. padding: 36px 32px;
  416. }
  417. }
  418. /* Touch-specific improvements */
  419. @media (hover: none) and (pointer: coarse) {
  420. /* This targets touch devices specifically */
  421. .new-btn:hover,
  422. .dialog-btn:hover,
  423. .theme-switch:hover {
  424. /* Remove hover effects on touch devices */
  425. background: var(--accent-primary);
  426. opacity: 1;
  427. }
  428. .dialog-btn.secondary:hover {
  429. background: var(--accent-secondary);
  430. opacity: 1;
  431. }
  432. .theme-switch:hover {
  433. background: var(--bg-tertiary);
  434. }
  435. /* Add active states for touch feedback */
  436. .new-btn:active {
  437. background: var(--accent-primary-hover);
  438. transform: scale(0.98);
  439. }
  440. .dialog-btn:active {
  441. transform: scale(0.98);
  442. }
  443. .theme-switch:active {
  444. transform: scale(0.95);
  445. }
  446. }
  447. /* High-DPI displays */
  448. @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  449. .theme-switch::before {
  450. box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  451. }
  452. .id-input-dialog {
  453. box-shadow: 0 8px 32px var(--shadow);
  454. }
  455. }
  456. /* Landscape orientation optimizations */
  457. @media screen and (max-height: 500px) and (orientation: landscape) {
  458. .header {
  459. min-height: 48px;
  460. padding: 10px 15px;
  461. }
  462. .title {
  463. font-size: 14px;
  464. gap: 4px;
  465. }
  466. .title img {
  467. height: 20px;
  468. width: 20px;
  469. border-radius: 3px;
  470. }
  471. .new-btn {
  472. padding: 8px 12px;
  473. font-size: 12px;
  474. min-height: 36px;
  475. }
  476. .theme-switch {
  477. width: 40px;
  478. height: 22px;
  479. min-height: 36px;
  480. }
  481. .theme-switch::before {
  482. width: 14px;
  483. height: 14px;
  484. left: 4px;
  485. }
  486. .theme-switch.dark::before {
  487. transform: translateX(16px);
  488. }
  489. .note-area {
  490. padding: 15px;
  491. font-size: 15px;
  492. }
  493. .id-input-overlay {
  494. padding-top: 10vh;
  495. }
  496. .id-input-dialog {
  497. padding: 20px;
  498. max-width: 400px;
  499. }
  500. }
  501. /* Accessibility improvements */
  502. @media (prefers-reduced-motion: reduce) {
  503. * {
  504. animation-duration: 0.01ms !important;
  505. animation-iteration-count: 1 !important;
  506. transition-duration: 0.01ms !important;
  507. }
  508. .theme-switch::before {
  509. transition: none;
  510. }
  511. body {
  512. transition: none;
  513. }
  514. }
  515. /* Dark theme specific mobile adjustments */
  516. [data-theme="dark"] {
  517. /* Better contrast for mobile screens */
  518. --text-primary: #f0f0f0;
  519. --text-secondary: #c0c0c0;
  520. --border-primary: #4a4a4a;
  521. }
  522. @media screen and (max-width: 480px) {
  523. [data-theme="dark"] {
  524. --bg-primary: #0d1117;
  525. --bg-secondary: #1c2128;
  526. --bg-tertiary: #2d333b;
  527. }
  528. }