/* Generated from words.html by scripts/extract_wordbook_css.py. */
:root {
      --bg-dark: #0a0e27;
      --bg-gradient-1: #1a1f3a;
      --bg-gradient-2: #0f1429;
      --fg: #e8edf4;
      --muted: #8b92a7;
      --border: rgba(139, 146, 167, 0.15);
      --brand: #00f2fe;
      --brand-secondary: #4facfe;
      --accent: #f093fb;
      --accent-secondary: #f5576c;
      --card-bg: rgba(26, 31, 58, 0.6);
      --glass-bg: rgba(255, 255, 255, 0.05);
      --glass-border: rgba(255, 255, 255, 0.1);
      --word-color: #00f2fe;
      --glow-color: rgba(0, 242, 254, 0.4);
    }

    @keyframes gradientShift {
      0%, 100% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
    }

    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    @keyframes glow {
      0%, 100% { box-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color); }
      50% { box-shadow: 0 0 30px var(--glow-color), 0 0 60px var(--glow-color); }
    }

    @keyframes slideInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes shimmer {
      0% { background-position: -1000px 0; }
      100% { background-position: 1000px 0; }
    }

    html, body {
      margin: 0;
      padding: 0;
      overflow-x: hidden;
    }

    body {
      background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1429 100%);
      background-attachment: fixed;
      color: var(--fg);
      font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
      min-height: 100vh;
      position: relative;
    }

    body::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 242, 254, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(240, 147, 251, 0.08) 0%, transparent 50%);
      pointer-events: none;
      z-index: 0;
      will-change: opacity;
      transform: translateZ(0);
    }

    .bg-grid {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-image:
        linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
      background-size: 50px 50px;
      pointer-events: none;
      z-index: 0;
      will-change: transform;
      transform: translateZ(0);
      /* animation: gridMove 20s linear infinite; */
    }

    @keyframes gridMove {
      0% { transform: translate(0, 0); }
      100% { transform: translate(50px, 50px); }
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 40px 24px;
      position: relative;
      z-index: 1;
      animation: slideInUp 0.8s ease-out;
      transition: padding-bottom 0.3s ease;
    }

    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      background: var(--glass-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      padding: 20px 28px;
      border-radius: 20px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      position: relative;
      overflow: hidden;
      will-change: transform;
      transform: translateZ(0);
    }

    .header::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
      animation: shimmer 3s infinite;
    }

    .title {
      display: flex;
      align-items: center;
      gap: 14px;
      position: relative;
      z-index: 1;
    }

    .logo {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background: url('icons/icon.png') center/cover no-repeat;
      box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
      border: 2px solid var(--glass-border);
      animation: float 3s ease-in-out infinite;
    }

    h1 {
      font-size: 28px;
      margin: 0;
      background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      font-weight: 700;
      letter-spacing: 0.5px;
    }

    .actions {
      display: flex;
      gap: 12px;
      position: relative;
      z-index: 1;
    }

    button {
      background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
      color: var(--brand);
      border: 1px solid var(--brand);
      border-radius: 12px;
      padding: 10px 20px;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(10px);
    }

    button::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 0;
      height: 0;
      border-radius: 50%;
      background: rgba(0, 242, 254, 0.3);
      transform: translate(-50%, -50%);
      transition: width 0.6s, height 0.6s;
    }

    button:hover::before {
      width: 300px;
      height: 300px;
    }

    button:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 242, 254, 0.4);
      background: linear-gradient(135deg, rgba(79, 172, 254, 0.3) 0%, rgba(0, 242, 254, 0.3) 100%);
    }

    button:active {
      transform: translateY(0);
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
      border: 1px solid var(--accent);
      color: white;
    }

    .btn-primary:hover {
      box-shadow: 0 8px 24px rgba(240, 147, 251, 0.5);
    }

    .hr {
      height: 1px;
      background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
      margin: 24px 0;
      border: none;
    }

    .status {
      color: var(--muted);
      font-size: 13px;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0 24px;
      overflow: visible;
      align-items: start;
      contain: layout;
    }

    .row {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      height: 72px;
      box-sizing: border-box;
      background: var(--glass-bg);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid var(--glass-border);
      border-radius: 14px;
      margin-bottom: 12px;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      z-index: 1;
      will-change: transform;
      transform: translateZ(0);
      contain: layout style paint;
    }

    .row.row-expanded {
      overflow: visible;
      z-index: 10;
      contain: none;
    }

    .row::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.1), transparent);
      transition: left 0.6s;
    }

    /* Disable ::before animation when details are visible */
    .row.row-expanded::before {
      display: none;
    }

    .row:hover {
      transform: translateY(-4px);
      border-color: rgba(0, 242, 254, 0.3);
      box-shadow: 0 8px 32px rgba(0, 242, 254, 0.2);
    }

    .row:hover::before {
      left: 100%;
    }

    .row.learned { opacity: 0.5; text-decoration: line-through; }
    .row.learned .word { color: var(--muted); }

    .word-index {
      color: var(--brand);
      font-size: 11px;
      font-weight: 700;
      width: 28px;
      text-align: center;
      flex-shrink: 0;
      background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.1));
      border-radius: 6px;
      padding: 3px;
    }

    .word-content {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 40px;
      align-items: center;
      flex: 1 1 0;
      min-width: 0;
    }

    .word {
      font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
      font-weight: 700;
      font-size: 16px;
      color: var(--word-color);
      display: flex;
      align-items: center;
      gap: 8px;
      text-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
    }

    .word-text {
      cursor: pointer;
      position: relative;
      transition: all 0.3s ease;
    }

    .word-text:hover {
      color: var(--accent);
      text-shadow: 0 0 20px rgba(240, 147, 251, 0.8);
    }

    .word-text::after {
      content: '';
      position: absolute;
      bottom: -2px;
      left: 0;
      width: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--brand), var(--accent));
      transition: width 0.3s ease;
    }

    .word-text:hover::after {
      width: 100%;
    }

    .pronounce {
      font-size: 14px;
      cursor: pointer;
      opacity: 0.6;
      transition: all 0.3s ease;
      filter: grayscale(100%);
    }

    .pronounce:hover {
      opacity: 1;
      filter: grayscale(0%);
      transform: scale(1.2);
    }

    .trans {
      font-size: 13px;
      color: var(--muted);
      text-align: right;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* 多词性释义（最多2行）*/
    .trans-multiline {
      white-space: normal;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
      overflow: hidden;
      max-height: calc(13px * 1.4 * 2 + 4px); /* 最多显示2行 */
    }

    .trans-line {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.4;
      text-align: right;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
    }

    /* 有多行释义时，行内容顶部对齐 */
    .row:has(.trans-multiline) {
      align-items: center;
    }

    .details-container {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      display: none;
      overflow: hidden;
      background: rgba(10, 14, 39, 0.95);
      backdrop-filter: blur(20px);
      margin: 0;
      padding: 0;
      text-align: left;
      border-radius: 12px;
      z-index: 100;
    }

    .details-container.visible {
      display: block;
      max-height: 600px;
      margin-top: 8px;
      padding: 16px;
      border: 1px solid var(--glass-border);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
      animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .details-section h4 {
      margin: 8px 0 12px 0;
      font-size: 14px;
      color: var(--brand);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .details-section p, .details-error {
      font-size: 13px;
      color: var(--muted);
      margin: 6px 0 12px 0;
      line-height: 1.6;
    }

    .sentence-en {
      font-style: italic;
      color: var(--fg);
    }

    .sentence-cn {
      color: var(--muted);
      opacity: 0.8;
    }

    .meta {
      font-size: 11px;
      color: var(--muted);
      margin-top: 4px;
    }

    .empty {
      padding: 60px 20px;
      color: var(--muted);
      text-align: center;
      font-size: 16px;
      background: var(--glass-bg);
      border-radius: 20px;
      border: 1px solid var(--glass-border);
    }

    /* Heatmap 样式 */
    #heatmap-container-words {
      background: var(--glass-bg);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid var(--glass-border);
      border-radius: 20px;
      padding: 24px;
      margin: 24px 0 32px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      will-change: transform;
      transform: translateZ(0);
    }

    #heatmap-container-words h4 {
      margin: 0 0 16px 0;
      font-size: 16px;
      font-weight: 700;
      background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      letter-spacing: 0.5px;
    }

    .heatmap {
      display: grid;
      grid-template-columns: repeat(53, 12px);
      grid-template-rows: repeat(7, 12px);
      grid-gap: 4px;
      padding: 12px 0;
    }

    .box {
      width: 12px;
      height: 12px;
      border-radius: 3px;
      background-color: rgba(139, 146, 167, 0.1);
      transition: all 0.3s ease;
      border: 1px solid transparent;
    }

    .box:hover {
      transform: scale(1.5);
      z-index: 10;
      border-color: var(--brand);
    }

    .level-0 { background-color: rgba(139, 146, 167, 0.1); }
    .level-1 { background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(79, 172, 254, 0.3)); box-shadow: 0 0 8px rgba(0, 242, 254, 0.3); }
    .level-2 { background: linear-gradient(135deg, rgba(0, 242, 254, 0.6), rgba(79, 172, 254, 0.6)); box-shadow: 0 0 12px rgba(0, 242, 254, 0.5); }
    .level-3 { background: linear-gradient(135deg, var(--brand), var(--brand-secondary)); box-shadow: 0 0 16px rgba(0, 242, 254, 0.8); }

    .list-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 24px;
      gap: 16px;
      background: var(--glass-bg);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid var(--glass-border);
      border-radius: 16px;
      padding: 16px 20px;
      flex-wrap: wrap;
      will-change: transform;
      transform: translateZ(0);
      position: relative;
      z-index: 50;
    }

    .list-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .status { flex-grow: 1; }

    .pagination {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
    }

    .pagination button {
      background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.15));
      color: var(--brand);
      border: 1px solid var(--brand);
      border-radius: 10px;
      padding: 8px 16px;
      cursor: pointer;
      font-weight: 600;
      transition: all 0.3s ease;
    }

    .pagination button:hover:not(:disabled) {
      background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(79, 172, 254, 0.25));
      box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
      transform: translateY(-2px);
    }

    .pagination button:disabled {
      color: var(--muted);
      border-color: var(--muted);
      cursor: not-allowed;
      opacity: 0.3;
    }

    .pagination span {
      font-size: 13px;
      color: var(--fg);
      font-weight: 600;
      min-width: 60px;
      text-align: center;
    }

    .pagination select {
      border-radius: 10px;
      padding: 8px 12px;
      font-size: 13px;
      border: 1px solid var(--brand);
      background: var(--glass-bg);
      backdrop-filter: blur(10px);
      color: var(--brand);
      cursor: pointer;
      font-weight: 600;
      transition: all 0.3s ease;
    }

    .pagination select:hover {
      background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.15));
      box-shadow: 0 4px 16px rgba(0, 242, 254, 0.2);
    }

    .btn-toggle {
      background: transparent;
      border: 1px solid var(--muted);
      color: var(--muted);
      font-size: 13px;
      padding: 8px 16px;
      cursor: pointer;
      border-radius: 10px;
      font-weight: 600;
      transition: all 0.3s ease;
    }

    .btn-toggle:hover {
      border-color: var(--brand);
      color: var(--brand);
      background: rgba(0, 242, 254, 0.1);
      box-shadow: 0 4px 16px rgba(0, 242, 254, 0.2);
    }

    /* Export Dropdown */
    .export-dropdown {
      position: relative;
    }

    .dropdown-menu {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      min-width: 150px;
      background: rgba(10, 14, 39, 0.95);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      border-radius: 10px;
      overflow: hidden;
      z-index: 200;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    .dropdown-menu.open {
      display: block;
    }

    .dropdown-item {
      padding: 10px 16px;
      font-size: 13px;
      color: var(--muted);
      cursor: pointer;
      font-weight: 600;
      transition: all 0.2s ease;
      white-space: nowrap;
    }

    .dropdown-item:hover {
      background: rgba(0, 242, 254, 0.1);
      color: var(--brand);
    }

    .dropdown-item + .dropdown-item {
      border-top: 1px solid var(--glass-border);
    }

    .list.hide-translation .trans { display: none; }
    .list.hide-translation .row:hover .trans { display: block; }

    /* Modal Styles */
    .modal-overlay {
      display: flex;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(10, 14, 39, 0.95);
      backdrop-filter: blur(20px);
      justify-content: center;
      align-items: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .modal-overlay.visible {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    .modal-content {
      background: var(--glass-bg);
      backdrop-filter: blur(30px);
      border: 2px solid var(--glass-border);
      padding: 32px;
      border-radius: 24px;
      text-align: center;
      max-width: 90vw;
      max-height: 90vh;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 80px rgba(0, 242, 254, 0.2);
      animation: slideInUp 0.4s ease-out;
    }

    #preview-img {
      max-width: 100%;
      max-height: calc(90vh - 180px);
      border: 2px solid var(--glass-border);
      border-radius: 16px;
      margin-bottom: 24px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .modal-actions {
      display: flex;
      gap: 16px;
      justify-content: center;
    }

    .modal-actions button {
      margin: 0;
      min-width: 120px;
    }

    /* CSV 预览 Modal */
    .csv-modal-content {
      width: 800px;
      max-width: 92vw;
      text-align: left;
      padding: 28px;
    }

    .csv-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 20px;
    }

    .csv-modal-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--fg);
      margin-bottom: 6px;
    }

    .csv-word-count {
      font-size: 12px;
      color: var(--brand);
      font-weight: 600;
    }

    .csv-modal-close {
      background: transparent;
      border: none;
      color: var(--muted);
      font-size: 16px;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 6px;
      line-height: 1;
    }

    .csv-modal-close:hover {
      color: var(--fg);
      background: rgba(255,255,255,0.05);
    }

    .csv-preview-body {
      max-height: 600px;
      overflow-y: auto;
      border: 1px solid var(--glass-border);
      border-radius: 12px;
      margin-bottom: 24px;
    }

    /* 单词+释义 表格 */
    .csv-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }

    .csv-table th {
      position: sticky;
      top: 0;
      background: rgba(0, 242, 254, 0.1);
      color: var(--brand);
      font-weight: 700;
      padding: 10px 14px;
      text-align: left;
      border-bottom: 1px solid var(--glass-border);
    }

    .csv-table td {
      padding: 8px 14px;
      color: var(--fg);
      border-bottom: 1px solid rgba(255,255,255,0.04);
      vertical-align: top;
    }

    .csv-table tr:last-child td {
      border-bottom: none;
    }

    .csv-table tr:hover td {
      background: rgba(0, 242, 254, 0.04);
    }

    .csv-table .col-no {
      width: 40px;
      color: var(--muted);
    }

    .csv-table .col-word {
      width: 160px;
      font-weight: 600;
      color: var(--word-color);
    }

    .csv-table .col-trans {
      color: var(--muted);
    }

    /* 仅单词 列表 */
    .csv-words-list {
      padding: 12px 16px;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px 12px;
    }

    .csv-words-list .csv-word-item {
      font-size: 13px;
      color: var(--word-color);
      font-weight: 600;
      padding: 4px 0;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    /* Modal 打开时冻结背景，防止 selection 穿透导致屏闪 */
    body.modal-open #main-container {
      user-select: none;
      pointer-events: none;
    }

    /* Scrollbar Styling */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: rgba(10, 14, 39, 0.3);
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb {
      background: linear-gradient(135deg, var(--brand), var(--accent));
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(135deg, var(--accent), var(--brand));
    }

    /* Responsive Design */
    @media (max-width: 768px) {
      .list {
        grid-template-columns: 1fr;
      }

      .container {
        padding: 24px 16px;
      }

      h1 {
        font-size: 22px;
      }

      .header {
        flex-direction: column;
        gap: 12px;
      }

      .actions {
        width: 100%;
        justify-content: stretch;
      }

      .actions button {
        flex: 1;
      }
    }
