:root {
  --color-primary: #C41E3A;
  --color-primary-dark: #9A1830;
  --color-gold: #D4A84B;
  --color-gold-light: #E8D5A3;
  --color-gold-dark: #B8943A;
  --color-dark: #1A1A1A;
  --color-bg: #F8F5F0;
  --color-white: #FFFFFF;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-border: #E8D5A3;
  --color-success: #2E8B57;
  --color-warning: #F5A623;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --font-base: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; outline: none; }
ul, ol { list-style: none; }

.container { width: 100%; padding: 0 16px; max-width: 768px; margin: 0 auto; }
@media (min-width: 576px) { .container { padding: 0 24px; } }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(180deg, rgba(26,18,18,0.85) 0%, rgba(26,18,18,0.6) 60%, transparent 100%);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background 0.3s;
}
.site-header.scrolled {
  background: rgba(26,18,18,0.95);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 16px; max-width: 768px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700;
}
.logo-text { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 1px; line-height: 1.2; }
.logo-text small { display: block; font-size: 10px; font-weight: 400; opacity: 0.8; letter-spacing: 0.5px; }
.menu-btn {
  width: 40px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}

/* Header User Entry */
.header-user { display: flex; align-items: center; margin-left: auto; margin-right: 8px; }
.header-user-btn {
  padding: 5px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.header-user-btn:hover { background: rgba(255,255,255,0.2); }
.header-user-info {
  display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 20px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
}
.header-user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  object-fit: cover; flex-shrink: 0;
}
.header-user-name { color: #fff; font-size: 13px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-menu {
  position: absolute; top: 48px; right: 56px; background: #fff; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px 0; min-width: 100px; z-index: 1001;
}
.header-user-menu-item,
a.header-user-menu-item {
  display: block; width: 100%; padding: 8px 14px; text-align: left; font-size: 14px; color: var(--color-text);
  background: none; cursor: pointer;
}
.header-user-menu-item:hover,
a.header-user-menu-item:hover { background: var(--color-bg); color: var(--color-primary); }
.menu-btn span {
  display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s;
}
.menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Sidebar Nav */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1999;
  opacity: 0; visibility: hidden; transition: opacity 0.3s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 75%; max-width: 300px;
  background: linear-gradient(180deg, #1a1212 0%, #2a1a1a 100%); z-index: 2000;
  transform: translateX(-100%); transition: transform 0.3s ease; padding: 24px 0;
  display: flex; flex-direction: column;
}
.sidebar.active { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; gap: 10px; padding: 0 20px 20px;
  border-bottom: 1px solid rgba(212,168,75,0.2); margin-bottom: 12px;
}
.sidebar-header .logo-icon { width: 32px; height: 32px; font-size: 14px; }
.sidebar-header .logo-text { font-size: 14px; }
.sidebar-menu { flex: 1; overflow-y: auto; }
.sidebar-menu li a {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  color: #fff; font-size: 15px; transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
  background: rgba(196,30,58,0.15); color: var(--color-gold); border-left-color: var(--color-gold);
}
.sidebar-menu li a svg { width: 20px; height: 20px; opacity: 0.7; flex-shrink: 0; }
.sidebar-menu li a:hover svg, .sidebar-menu li a.active svg { opacity: 1; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(212,168,75,0.2);
  font-size: 12px; color: var(--color-gold-light); opacity: 0.6; text-align: center;
}

/* Section Title */
.section-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.section-title h2 { font-size: 20px; font-weight: 700; color: var(--color-dark); }
.section-title .line {
  flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-gold-light), transparent);
}
.section-title .more-link {
  font-size: 13px; color: var(--color-primary); display: flex; align-items: center; gap: 2px;
}

/* Card Base */
.card {
  background: var(--color-white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.card:active { transform: scale(0.98); }

/* Tag */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
}
.tag-red { background: rgba(196,30,58,0.1); color: var(--color-primary); }
.tag-gold { background: rgba(212,168,75,0.15); color: var(--color-gold-dark); }
.tag-green { background: rgba(46,139,87,0.1); color: var(--color-success); }
.tag-orange { background: rgba(245,166,35,0.1); color: var(--color-warning); }
.tag-gray { background: rgba(0,0,0,0.05); color: var(--color-text-muted); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
  transition: all 0.2s; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: #fff; box-shadow: 0 4px 12px rgba(196,30,58,0.3); }
.btn-primary:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark)); color: #fff; box-shadow: 0 4px 12px rgba(212,168,75,0.3); }
.btn-outline { border: 1px solid var(--color-gold); color: var(--color-gold-dark); background: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.form-group label .required { color: var(--color-primary); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: var(--radius-md);
  font-size: 15px; background: var(--color-white); transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(212,168,75,0.15); }
.form-input.error, .form-select.error, .form-textarea.error { border-color: var(--color-primary); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { color: var(--color-primary); font-size: 12px; margin-top: 4px; display: none; }
.form-error.show { display: block; }

/* Image Upload */
.upload-area {
  border: 2px dashed var(--color-gold-light); border-radius: var(--radius-md);
  padding: 24px; text-align: center; background: rgba(212,168,75,0.04); cursor: pointer; transition: all 0.2s;
}
.upload-area:active { background: rgba(212,168,75,0.08); }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.upload-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }

/* Footer */
.site-footer {
  background: var(--color-dark); color: rgba(255,255,255,0.6); padding: 32px 0 24px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.footer-col h4 { font-size: 14px; color: var(--color-gold); margin-bottom: 10px; font-weight: 600; }
.footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,0.5); padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--color-gold-light); }
.footer-bottom { text-align: center; font-size: 12px; color: rgba(255,255,255,0.3); border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; }
.footer-contact { font-size: 13px; line-height: 1.8; margin-bottom: 16px; }
.footer-contact p { display: flex; align-items: center; gap: 6px; }
.footer-contact svg { width: 16px; height: 16px; opacity: 0.5; }

/* Back to Top */
.back-to-top {
  position: fixed; right: 16px; bottom: 24px; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(20px); transition: all 0.3s; pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(26,18,18,0.9); color: #fff; padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 14px; z-index: 3000; opacity: 0; transition: all 0.3s; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-primary); }

/* Loading */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.8); z-index: 2500;
  display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.loading-overlay.active { opacity: 1; visibility: visible; }
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--color-gold-light); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page padding for fixed header */
.page-content { padding-top: 56px; }

/* Floating customer service button */
.chat-float-btn {
  position: fixed; right: 16px; bottom: 76px; z-index: 998;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: transform 0.2s;
}
.chat-float-btn:hover { transform: scale(1.05); }
.chat-float-btn svg { width: 26px; height: 26px; }

/* Login prompt overlay */
.login-guard {
  position: fixed; inset: 0; background: rgba(255,255,255,0.96); z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.login-guard p { font-size: 15px; color: var(--color-text); margin-bottom: 20px; }
.login-guard .btn { min-width: 140px; }

/* Chat window */
.chat-window {
  display: flex; flex-direction: column; height: calc(100vh - 56px); background: var(--color-bg); padding-top: 56px;
}
.chat-header {
  background: #fff; padding: 14px 16px; border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.chat-title { font-size: 15px; font-weight: 600; }
.chat-status { font-size: 12px; color: var(--color-success); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 80%; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.admin { align-self: flex-start; }
.chat-msg-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word;
}
.chat-msg.user .chat-msg-bubble { background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.admin .chat-msg-bubble { background: #fff; color: var(--color-text); border-bottom-left-radius: 4px; border: 1px solid var(--color-border); }
.chat-msg-time { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.chat-input-area {
  background: #fff; border-top: 1px solid var(--color-border); padding: 10px 12px; flex-shrink: 0;
  display: flex; gap: 8px; align-items: center;
}
.chat-input {
  flex: 1; border: 1px solid var(--color-border); border-radius: 20px; padding: 9px 14px; font-size: 14px; outline: none;
}
.chat-input:focus { border-color: var(--color-gold); }
.chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; border: none; flex-shrink: 0;
}
.chat-empty { text-align: center; color: var(--color-text-muted); font-size: 13px; padding: 20px; }

/* Chat image message */
.chat-msg-bubble.chat-msg-image {
  padding: 6px; border-radius: 14px; overflow: hidden; background: transparent;
}
.chat-msg-bubble.chat-msg-image img {
  max-width: 200px; max-height: 200px; width: auto; height: auto;
  border-radius: 10px; display: block; object-fit: cover;
}
.chat-msg-bubble.chat-msg-image img {
  max-width: 200px; max-height: 200px; border-radius: 10px; display: block; object-fit: cover;
}
.chat-msg-bubble.chat-msg-image .img-error {
  font-size: 12px; color: var(--color-text-muted); padding: 10px;
}

/* Chat card message */
.chat-msg-bubble.chat-msg-card-wrap {
  padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--color-gold-light);
}
.chat-msg-card {
  display: flex; gap: 10px; padding: 10px; text-decoration: none; color: var(--color-text);
}
.chat-msg-card:active { opacity: 0.85; }
.chat-card-thumb {
  width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--color-bg);
}
.chat-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.chat-card-tag {
  font-size: 10px; font-weight: 600; color: var(--color-gold-dark); background: rgba(212,168,75,0.12);
  padding: 2px 6px; border-radius: 8px; display: inline-block; width: fit-content;
}
.chat-card-title { font-size: 13px; font-weight: 600; color: var(--color-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-card-id { font-size: 11px; color: var(--color-text-muted); }

/* Chat toolbar */
.chat-toolbar {
  display: flex; gap: 8px; padding: 8px 12px 0; background: #fff;
}
.chat-tool-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 14px;
  background: var(--color-bg); color: var(--color-text-secondary); border: 1px solid var(--color-border);
  font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.chat-tool-btn:active { background: var(--color-gold-light); border-color: var(--color-gold); }
