/* =====================================================
   元速工具 - 全局样式
   编辑精选 / 杂志风 · 暖陶土 + 墨绿 + 奶油色
   ===================================================== */

:root {
  --primary: #c2410c;
  --primary-dark: #9a3412;
  --primary-light: #ffedd5;
  --secondary: #0f766e;
  --secondary-dark: #134e4a;
  --secondary-light: #ccfbf1;
  --accent: #a16207;
  --accent-light: #fef3c7;

  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;

  --bg: #faf7f2;
  --bg-cream: #f5efe6;
  --bg-card: #ffffff;
  --bg-paper: #fdfaf4;
  --text: #292524;
  --text-secondary: #57534e;
  --text-light: #a8a29e;
  --border: #e7e0d5;
  --border-light: #f0ebe3;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(41, 37, 36, 0.05);
  --shadow: 0 4px 14px rgba(41, 37, 36, 0.06);
  --shadow-lg: 0 16px 40px rgba(41, 37, 36, 0.1);
  --shadow-soft: 0 2px 8px rgba(41, 37, 36, 0.04);

  --header-height: 60px;
  --bottom-nav-height: 58px;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Helvetica, "Microsoft YaHei", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* ============== 顶部导航 ============== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-4deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 2px 3px 0 var(--accent-light);
}

.header-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-login-btn {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.2s;
}

.header-login-btn:active {
  background: var(--primary-light);
  transform: scale(0.97);
}

.header-profile-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.header-profile-link:active {
  color: var(--primary);
}

/* ============== 搜索框 ============== */
.search-bar {
  padding: 12px 16px;
  background: transparent;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  padding: 10px 18px;
  gap: 10px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.search-input-wrap .icon {
  color: var(--text-light);
  font-size: 16px;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.search-input-wrap input::placeholder {
  color: var(--text-light);
}

/* ============== Banner ============== */
.banner {
  margin: 16px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #c2410c 0%, #9a3412 50%, #7c2d12 100%);
  padding: 28px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.banner::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255, 237, 213, 0.1);
  border-radius: 50%;
}

.banner-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.5px;
}

.banner-desc {
  font-size: 13px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.banner-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============== 分区标题 ============== */
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 18px 12px;
}

.section-title h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  position: relative;
}

.section-title h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.section-title .more {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============== 分类导航 ============== */
.category-nav {
  padding: 0 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

.category-item:active {
  transform: scale(0.95);
}

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
}

.category-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
  font-weight: 500;
}

/* ============== 工具卡片（贴纸风格） ============== */
.tools-section {
  padding: 0 18px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-sm);
}

.tool-card:nth-child(2n) {
  transform: translateY(2px) rotate(0.4deg);
}

.tool-card:nth-child(3n) {
  transform: translateY(-1px) rotate(-0.3deg);
}

.tool-card:active {
  transform: scale(0.97) rotate(0);
}

.tool-card .badge {
  position: absolute;
  top: -8px;
  left: -6px;
  padding: 3px 10px;
  font-size: 10px;
  color: #fff;
  border-radius: 6px 6px 6px 0;
  font-weight: 700;
  letter-spacing: 0.5px;
  transform: rotate(-6deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.tool-card .badge.hot {
  background: #dc2626;
}

.tool-card .badge.new {
  background: #059669;
}

.tool-card .badge.free {
  background: #d97706;
}

.tool-icon {
  font-size: 34px;
  margin-bottom: 10px;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.08));
}

.tool-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.tool-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-serif);
}

.tool-price.free {
  color: var(--success);
  font-size: 14px;
}

.tool-price::before {
  content: '¥';
  font-size: 11px;
  font-weight: 500;
}

.tool-price:not(.free)::after {
  content: '/永久使用';
  font-size: 11px;
  font-weight: 500;
  margin-left: 2px;
  opacity: 0.8;
}

.tool-price.free::before {
  content: '';
}

.tool-use-count {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}

/* ============== 传播性星级 ============== */
.spread-stars {
  display: flex;
  gap: 1px;
  font-size: 10px;
  margin-top: 4px;
}

.spread-stars .star {
  color: #f59e0b;
}

.spread-stars .star.empty {
  color: var(--border);
}

/* ============== 底部导航 ============== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  display: flex;
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item .icon {
  font-size: 20px;
}

.bottom-nav-item .label {
  font-size: 10px;
  font-weight: 500;
}

/* ============== 按钮 ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 24px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  width: 100%;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:active {
  background: var(--primary-light);
}

.btn-block {
  width: 100%;
}

/* ============== 表单 ============== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1);
}

.form-input.error {
  border-color: var(--danger);
}

/* ============== Toast ============== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(41, 37, 36, 0.88);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ============== Loading ============== */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 247, 242, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============== 登录注册页面 ============== */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, #ffedd5 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, #ccfbf1 0%, transparent 40%),
    var(--bg);
  padding: 40px 24px 24px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo .logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: var(--primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-4deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  box-shadow: 4px 6px 0 var(--accent-light);
}

.auth-logo h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  background: var(--bg-cream);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.auth-form .btn {
  margin-top: 8px;
}

.auth-tips {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 16px;
  line-height: 1.5;
}

.auth-tips a {
  color: var(--primary);
}

/* ============== 工具详情页 ============== */
.tool-detail-page {
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
  background: var(--bg-paper);
}

.tool-detail-header {
  padding: 24px 18px 28px;
  background:
    linear-gradient(135deg, rgba(194, 65, 12, 0.08), rgba(15, 118, 110, 0.06)),
    var(--bg-paper);
  border-bottom: 1px dashed var(--border);
}

.tool-detail-icon {
  font-size: 56px;
  margin-bottom: 14px;
  filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.1));
}

.tool-detail-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.tool-detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tool-detail-info {
  background: #fff;
  margin: 14px 16px;
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.tool-detail-info::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  opacity: 0.5;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* 底部固定栈 */
.bottom-fixed-stack {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
}

.bottom-action-bar {
  background: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  box-sizing: border-box;
  width: 100%;
}

.bottom-action-bar .price-info {
  flex: 1;
}

.bottom-action-bar .price-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.bottom-action-bar .price-value {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.bottom-action-bar .price-value::before {
  content: '¥';
  font-size: 14px;
  font-weight: 500;
}

.bottom-action-bar .btn {
  width: auto;
  padding: 12px 32px;
}

.bottom-icp-bar {
  background: var(--bg-cream);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  font-size: 11px;
  line-height: 16px;
  color: var(--text-light);
  border-top: 1px solid var(--border-light);
  box-sizing: border-box;
  width: 100%;
}
.bottom-icp-bar .icp-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  width: 100%;
  text-align: center;
}
.bottom-icp-bar .icp-row + .icp-row {
  margin-top: 2px;
}
.bottom-icp-bar a {
  color: var(--text-light);
  text-decoration: none;
  white-space: nowrap;
}
.bottom-icp-bar .dot {
  margin: 0 4px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ============== 支付页面 ============== */
.pay-page {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 100px;
}

.pay-user-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 20px 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pay-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.pay-user-info .nickname {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.pay-user-info .email {
  font-size: 12px;
  opacity: 0.9;
}

.pay-section {
  background: #fff;
  margin: -14px 16px 12px;
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.pay-section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.pay-goods-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.pay-goods-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.pay-goods-info {
  flex: 1;
  min-width: 0;
}

.pay-goods-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-goods-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.pay-goods-price {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.pay-goods-price::before {
  content: '¥';
  font-size: 12px;
  font-weight: 500;
}

.pay-method-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pay-method-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.pay-method-item:last-child {
  border-bottom: none;
}

.pay-method-icon {
  width: auto;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.pay-method-icon img {
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pay-method-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.pay-method-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.pay-method-item.selected .pay-method-radio {
  border-color: var(--primary);
}

.pay-method-item.selected .pay-method-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.pay-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border-light);
  z-index: 100;
}

.pay-bottom-bar .total-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.pay-bottom-bar .total-price {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.pay-bottom-bar .total-price::before {
  content: '¥';
  font-size: 14px;
  font-weight: 500;
}

.pay-bottom-bar .btn {
  width: auto;
  padding: 12px 36px;
}

/* ============== 工具分类页面 ============== */
.category-page {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

.category-header {
  background: #fff;
  padding: 12px 16px;
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  border-bottom: 1px solid var(--border-light);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-cream);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
  border: 1px solid transparent;
}

.category-tab.active {
  background: var(--text);
  color: #fff;
  font-weight: 600;
  border-color: var(--text);
}

.category-tool-list {
  padding: 14px 16px;
}

/* ============== 个人中心 ============== */
.profile-page {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 28px 16px 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.profile-nickname {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-email {
  font-size: 13px;
  opacity: 0.9;
}

.profile-stats {
  display: flex;
  background: #fff;
  margin: -36px 16px 14px;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.profile-stat-item {
  flex: 1;
  text-align: center;
}

.profile-stat-item .num {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.profile-stat-item .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.profile-menu {
  background: #fff;
  margin: 0 16px 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:active {
  background: var(--bg-cream);
}

.profile-menu-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.profile-menu-item .label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.profile-menu-item .arrow {
  color: var(--text-light);
  font-size: 14px;
}

/* ============== 页脚备案号 ============== */
.footer-icp {
  text-align: center;
  padding: 24px 18px 28px;
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px dashed var(--border-light);
  margin-top: 16px;
}

.footer-icp a {
  color: var(--text-light);
  transition: color 0.2s;
}

.footer-icp a:hover {
  color: var(--primary);
}

.footer-icp .footer-company {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-weight: 600;
}

.footer-icp .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-icp .footer-contact {
  margin-bottom: 6px;
}

/* ============== 订单列表 ============== */
.order-list {
  padding: 12px 16px;
}

.order-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.order-tool-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.order-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.order-status.pending {
  color: var(--warning);
  background: var(--accent-light);
}

.order-status.paid {
  color: var(--success);
  background: var(--secondary-light);
}

.order-status.cancelled {
  color: var(--text-light);
  background: var(--bg-cream);
}

.order-status.refunded {
  color: var(--danger);
  background: #fee2e2;
}

.order-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-meta {
  min-width: 0;
}

.order-no {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.order-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.order-amount {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.order-amount::before {
  content: '¥';
  font-size: 12px;
  font-weight: 500;
}

.order-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}

.order-use-status {
  font-size: 12px;
  color: var(--text-secondary);
}

.order-use-status.used {
  color: var(--text-light);
}

.order-actions {
  display: flex;
  gap: 8px;
}

.order-action-btn {
  padding: 6px 16px;
  font-size: 12px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  background: #fff;
  font-weight: 500;
}

.order-action-btn.primary {
  border-color: var(--primary);
  color: var(--primary);
}

.order-action-btn.refund {
  border-color: var(--warning, #f59e0b);
  color: var(--warning, #f59e0b);
}

.order-refund-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  white-space: nowrap;
}

.order-refund-tag.refunding {
  color: var(--warning, #f59e0b);
  background: #fef3c7;
}

.order-refund-tag.refunded {
  color: var(--success, #10b981);
  background: var(--secondary-light, #d1fae5);
}

.order-refund-tag.rejected {
  color: var(--danger, #ef4444);
  background: #fee2e2;
}

.refund-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.refund-modal-overlay.show {
  opacity: 1;
}

.refund-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.refund-modal-overlay.show .refund-modal {
  transform: scale(1);
}

.refund-modal-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.refund-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  margin-bottom: 10px;
}

.refund-modal-desc {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.7;
  margin-bottom: 8px;
}

.refund-modal-order {
  font-size: 12px;
  color: var(--text-light, #94a3b8);
  margin-bottom: 16px;
  padding: 6px 12px;
  background: var(--bg-cream, #f5efe6);
  border-radius: 8px;
}

.refund-modal-tip {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.refund-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.refund-modal-btn {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.refund-modal-btn:active {
  opacity: 0.7;
}

.refund-modal-btn.cancel {
  background: var(--bg-cream, #f5efe6);
  color: var(--text-secondary, #64748b);
}

.refund-modal-btn.confirm {
  background: var(--primary, #c2410c);
  color: #fff;
}

.refund-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.load-more-wrap {
  text-align: center;
  padding: 8px 0 20px;
}

.load-more-btn {
  display: inline-block;
  padding: 8px 32px;
  font-size: 13px;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  font-weight: 500;
}

.load-more-btn:active {
  background: var(--primary-light);
}

/* ============== 响应式 - 平板 ============== */
@media (min-width: 768px) {
  .category-nav {
    grid-template-columns: repeat(10, 1fr);
  }

  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .auth-card {
    max-width: 420px;
    margin: 0 auto;
  }
}

/* ============== 响应式 - 桌面（1200px内容限宽） ============== */
@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .tool-card:hover {
    transform: translateY(-4px) rotate(0);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
    z-index: 2;
  }

  .tool-card {
    transition: all 0.25s ease;
  }

  .header {
    padding-left: calc(50% - 600px);
    padding-right: calc(50% - 600px);
  }

  .bottom-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .banner,
  .section-title,
  .tools-section,
  .pay-section,
  .profile-menu,
  .profile-stats,
  .tool-detail-info {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .section-title {
    padding: 28px 24px 14px;
  }

  .tools-section {
    padding: 0 24px;
  }

  .banner {
    padding: 36px 28px;
    border-radius: 24px;
  }

  .pay-user-header,
  .profile-header,
  .tool-detail-header {
    padding-left: calc(50% - 600px + 24px);
    padding-right: calc(50% - 600px + 24px);
  }

  .category-header {
    padding-left: 0;
    padding-right: 0;
  }

  .category-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .category-tool-list {
    padding: 16px 0;
  }

  .category-tool-list .tools-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .bottom-action-bar,
  .bottom-icp-bar,
  .pay-bottom-bar {
    padding-left: calc(50% - 600px + 24px);
    padding-right: calc(50% - 600px + 24px);
  }

  .orders-page .order-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
  }
}

@media (min-width: 1280px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============== 工具类 ============== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}