/**
 * 工具内页移动端增强：更大字号、更大触控区、更紧凑边距
 */

@media (max-width: 768px) {
  /* 通用：减少左右留白，卡片贴边更宽 */
  .tool-hero,
  .tool-card,
  .tools-wrap .site-main,
  .tools-wrap .site-hero,
  .tools-wrap .site-breadcrumb-bar {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .tool-hero {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  .tool-hero h1 {
    font-size: 28px !important;
    line-height: 1.25;
    margin-bottom: 10px !important;
  }

  .tool-hero p {
    font-size: 15px !important;
    line-height: 1.65;
  }

  .tool-card,
  .card {
    margin-left: 10px !important;
    margin-right: 10px !important;
    padding: 18px 16px !important;
    border-radius: 12px !important;
  }

  .section-title {
    font-size: 20px !important;
    margin-bottom: 14px !important;
  }

  /* 工具首页 */
  .tools-wrap .site-hero h1 {
    font-size: 26px !important;
  }

  .tools-wrap .site-card .section-title {
    font-size: 20px !important;
  }

  .tools-wrap .tools-nav {
    gap: 8px;
  }

  .tools-wrap .tools-nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    padding: 12px 10px !important;
    font-size: 16px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .tools-wrap .tool-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tools-wrap .tool-item {
    padding: 18px 16px !important;
  }

  .tools-wrap .tool-item h3 {
    font-size: 20px !important;
  }

  .tools-wrap .tool-item p {
    font-size: 15px !important;
    line-height: 1.65;
  }

  .tools-wrap .tool-ok {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 16px !important;
    font-size: 17px !important;
    box-sizing: border-box;
    min-height: 48px;
    line-height: 1.2;
  }

  /* 内页导航 */
  .tools-nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    padding: 12px 10px !important;
    font-size: 15px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .bank-tabs {
    padding: 0 10px !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .bank-tabs a {
    font-size: 14px !important;
    padding: 10px 12px !important;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 题库主展示区 */
  .word-box,
  .topic-box {
    font-size: 42px !important;
    min-height: 140px !important;
    padding: 28px 16px !important;
    line-height: 1.35 !important;
    letter-spacing: 0.5px;
    border-radius: 12px !important;
  }

  .topic-box {
    font-size: 22px !important;
    min-height: 120px !important;
    padding: 24px 16px !important;
  }

  /* 按钮 */
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-clear,
  .btn-danger,
  .btn-new-room {
    font-size: 17px !important;
    padding: 14px 18px !important;
    min-height: 50px;
    border-radius: 10px !important;
  }

  .btn[style*="width:100%"],
  .btn-primary[style*="width:100%"] {
    width: 100% !important;
  }

  .muted,
  .tip,
  .skip-hint {
    font-size: 14px !important;
    line-height: 1.6;
  }

  /* 骰子 */
  .dice-form {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .dice-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px !important;
    width: 100%;
  }

  .dice-form select,
  .color-select {
    width: 100%;
    font-size: 16px !important;
    min-height: 48px;
    padding: 10px 12px !important;
  }

  .dice-form .btn {
    width: 100%;
    margin-top: 4px;
  }

  .dice-grid {
    gap: 14px !important;
  }

  .dice-box {
    width: 112px !important;
    height: 112px !important;
    border-radius: 16px !important;
  }

  .dice-value {
    font-size: 36px !important;
  }

  .dice-meta {
    font-size: 15px !important;
    gap: 8px !important;
  }

  .dice-meta .pill {
    font-size: 14px !important;
    padding: 6px 12px !important;
  }

  .countdown-timer {
    font-size: 40px !important;
  }

  .history-table th,
  .history-table td {
    font-size: 14px !important;
    padding: 12px 8px !important;
  }

  /* 主题讨论 - 选房间 */
  .room-select-container {
    margin: 10px !important;
    padding: 16px 14px !important;
  }

  .page-header h1 {
    font-size: 26px !important;
  }

  .page-header p {
    font-size: 15px !important;
  }

  .search-input,
  .filter-select,
  .input-group input,
  .input-group textarea {
    font-size: 16px !important;
    min-height: 48px;
    padding: 12px 14px !important;
  }

  .room-name {
    font-size: 20px !important;
  }

  .room-info,
  .room-info-item {
    font-size: 15px !important;
  }

  .room-item {
    padding: 18px 14px !important;
  }

  .room-status {
    font-size: 13px !important;
    padding: 6px 12px !important;
  }

  /* 主题讨论 - 聊天室 */
  .chat-container {
    margin: 10px !important;
    border-radius: 12px !important;
  }

  .chat-header {
    padding: 16px 14px !important;
  }

  .chat-header h1 {
    font-size: 22px !important;
  }

  .chat-header .topic {
    font-size: 15px !important;
  }

  .chat-body {
    flex-direction: column;
    height: auto !important;
    min-height: 0;
  }

  .chat-messages {
    min-height: 50vh;
    max-height: 58vh;
    border-right: none !important;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px !important;
  }

  .chat-sidebar {
    width: 100% !important;
    max-height: none;
    padding: 14px !important;
  }

  .message-sender {
    font-size: 16px !important;
  }

  .message-content {
    font-size: 18px !important;
    line-height: 1.6 !important;
  }

  .message-time {
    font-size: 13px !important;
  }

  .user-list-title {
    font-size: 15px !important;
  }

  .user-tag {
    font-size: 14px !important;
    padding: 6px 10px !important;
  }

  .chat-input-area {
    padding: 14px !important;
  }

  .input-group label {
    font-size: 15px !important;
  }

  .input-group textarea {
    min-height: 80px !important;
  }

  .login-form {
    margin: 16px 10px !important;
    padding: 24px 18px !important;
  }

  .login-form h2 {
    font-size: 22px !important;
  }

  .tool-card .login-prompt-section h2 {
    font-size: 20px !important;
  }

  .tool-card .login-prompt-section p {
    font-size: 15px !important;
  }

  .room-link {
    padding: 14px 12px !important;
  }

  .room-link .room-name {
    font-size: 16px !important;
  }

  .room-link .room-meta {
    font-size: 14px !important;
  }

  /* 题库历史列表 */
  .history-list {
    max-height: none !important;
    padding: 12px !important;
  }

  .history-list .item {
    font-size: 16px !important;
    padding: 12px 10px !important;
    line-height: 1.5;
  }
}

@media (max-width: 420px) {
  .word-box {
    font-size: 36px !important;
    min-height: 120px !important;
  }

  .topic-box {
    font-size: 20px !important;
  }

  .dice-box {
    width: 96px !important;
    height: 96px !important;
  }

  .dice-value {
    font-size: 32px !important;
  }

  .bank-tabs a {
    font-size: 13px !important;
    padding: 8px 10px !important;
  }
}
