/* ========================================
   Yuanxi Service — Master Stylesheet
   Mobile-first, single-breakpoint architecture
   ======================================== */

/* --- 1. CSS Variables --------------------------------- */
:root {
  --color-primary: #333;
  --color-accent: #ff9800;
  --color-accent-hover: #f57c00;
  --color-accent-light: #fff8e1;
  --color-bg: #fff;
  --color-bg-hover: #f5f5f5;
  --color-text: #333;
  --color-text-secondary: #666;
  --color-text-muted: #999;
  --color-border: #e0e0e0;
  --color-success: #4ECDC4;
  --color-danger: #FF6B6B;
  --color-wechat: #07C160;
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 25px;
  --radius-round: 50%;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.15);
  --font-main: 'Roboto','SF Pro Text',-apple-system,BlinkMacSystemFont,sans-serif;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* --- 2. Reset & Base ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",STHeiti,"Microsoft Yahei",Tahoma,Simsun,sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
}

/* --- 3. Shared Utilities ------------------------------- */
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- 4. Layout: Container / Panel ---------------------- */
.container {
  background: transparent;
  max-width: 100%;
  margin: 0;
  padding: 0;
  padding-top: calc(70px + var(--safe-top));
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--safe-top) - var(--safe-bottom));
  overflow: visible;
}

.panel {
  display: none; padding: 0; margin: 0;
  background: var(--color-bg); border-radius: 0; box-shadow: none;
  position: relative; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.panel.active { display: block; animation: fadeIn 0.5s ease; }

#user-panel .container { padding-bottom: 80px; }

/* --- 5. Header ----------------------------------------- */
header {
  padding: 0 20px;
  padding-top: var(--safe-top);
  background: var(--color-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
  height: calc(44px + var(--safe-top));
}

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

header h1, header strong {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 1.1rem; font-weight: 600; margin: 0;
  font-family: var(--font-main);
}

/* --- 5b. Header Buttons (shared base) ------------------ */
.header-btn, .header-right button {
  background: none; border: none; color: var(--color-text);
  padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.header-btn:hover, .header-right button:hover { opacity: 0.6; }
.header-btn i, .header-right button i { font-size: 1.2rem; }
.header-btn span, .header-right button span, .new-chat-btn-header span { display: none; }

/* User button active style */
.user-btn-header.nav-item { flex: none; flex-direction: row; }
.user-btn-header.nav-item i, .user-btn-header i { color: #000; }

/* Back button */
.back-btn-header {
  position: absolute; top: 50%; left: 20px; transform: translateY(-50%);
  background: none; border: none; color: var(--color-text);
  padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: opacity 0.2s ease;
}
.back-btn-header:hover { opacity: 0.6; }
.back-btn-header i { font-size: 1.2rem; }

/* Title selector */
.title-selector {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 5px 10px; border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.title-selector:hover { background: var(--color-bg-hover); }
.title-text { font-size: 1.1rem; font-weight: 600; }
.title-arrow { font-size: 0.7rem; color: var(--color-text-secondary); transition: transform 0.3s; }
.title-selector.open .title-arrow { transform: rotate(180deg); }

.title-dropdown {
  position: absolute; top: 100%; left: 0;
  background: var(--color-bg); border-radius: 10px; padding: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15); z-index: 100;
  display: none; min-width: 120px; margin-top: 5px;
}
.title-dropdown.show { display: block; animation: fadeIn 0.2s ease; }

.title-option {
  display: flex; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; gap: 8px; transition: background 0.2s;
}
.title-option:hover { background: var(--color-bg-hover); }
.title-option img { width: 28px; height: 28px; border-radius: var(--radius-round); object-fit: cover; }
.title-option span { font-size: 0.9rem; font-weight: 500; }

/* --- 6. Chat Container --------------------------------- */
.chat-container {
  display: flex; flex-direction: column; flex: 1;
  overflow-y: auto;
  background: var(--color-bg);
  min-height: 0; position: relative;
}

.chat-history {
  flex: 1; overflow-y: auto;
  padding: 8px 12px 140px 12px;
  background: var(--color-bg);
}

/* --- 7. Welcome Screen --------------------------------- */
.welcome-screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--color-bg); z-index: 10;
  transition: opacity 0.5s, transform 0.5s; pointer-events: none;
}
.welcome-screen.hidden { opacity: 0; transform: translateY(-20px); display: none; }
.welcome-avatar {
  width: 120px; height: 120px; border-radius: var(--radius-round);
  overflow: hidden; margin-bottom: 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: welcomeFloat 3s ease-in-out infinite;
}
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; animation: welcomePulse 2s ease-in-out infinite; }
.welcome-text {
  max-width: 600px; text-align: center; font-size: 1.1rem;
  line-height: 1.8; color: var(--color-text); padding: 0 20px;
  animation: welcomeFadeIn 1s ease-out;
}

@keyframes welcomeFloat   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes welcomePulse   { 0%,100% { transform: scale(1); }    50% { transform: scale(1.05); } }
@keyframes welcomeFadeIn  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 8. Messages --------------------------------------- */
.message { max-width: 95%; margin-bottom: 18px; padding: 14px 18px; border-radius: 16px; animation: fadeIn 0.3s ease; box-shadow: 0 3px 10px rgba(0,0,0,0.05); }

/* User message – blue bubble, avatar outside on the right */
.user-message-wrapper { animation: fadeIn 0.3s ease; padding-right: 8px; }
.user-message {
  padding: 10px 14px; background-color: #e7f3fe; color: #07305e;
  border-radius: 16px; width: fit-content; max-width: 75%;
  margin-left: auto; margin-right: 0; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.user-message .message-content { font-size: 0.95rem; line-height: 1.6; }
.user-message::after { display: none; }
.user-message-wrapper .user-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  margin-bottom: 4px;
}
.user-message-wrapper .user-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.user-avatar {
  background: #ffa726; color: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; user-select: none;
}

/* AI message – left-aligned with avatar */
.ai-message {
  padding: 10px 14px; box-shadow: none; border-radius: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  margin-bottom: 18px;
}

/* Message avatars */
.message-avatar {
  width: 45px; height: 45px; border-radius: var(--radius-round);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2); overflow: hidden; flex-shrink: 0;
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-round); }

.ai-message-avatar {
  width: 45px; height: 45px; border-radius: var(--radius-round);
  overflow: hidden; position: relative; left: 0; top: 0; margin-bottom: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15); flex-shrink: 0;
}
.ai-message-avatar img { width: 100%; height: 100%; object-fit: cover; animation: aiPulse 2s ease-in-out infinite; }
@keyframes aiPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* Message content */
.message-content {
  font-size: 1.1rem; line-height: 1.7;
  white-space: pre-wrap !important; word-wrap: break-word !important; overflow-wrap: break-word !important;
  user-select: text; -webkit-user-select: text;
}
.ai-message .message-content { font-size: 0.95rem; line-height: 1.6; padding: 0; max-width: 100%; }

/* Copy button */
/* Thinking dots */
.thinking-dots span { display: inline-block; animation: thinkBounce 1.4s ease-in-out infinite; font-size: 1.1rem; color: var(--color-text-secondary); }
.thinking-dots span:nth-child(2) { animation-delay: 0.1s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(4){ animation-delay: 0.4s; }
.thinking-dots span:nth-child(5){ animation-delay: 0.5s; }
.thinking-dots span:nth-child(6){ animation-delay: 0.6s; }
@keyframes thinkBounce { 0%,80%,100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* --- 9. Input Area (fixed bottom) ---------------------- */
.input-area {
  padding: 10px 10px 5px 10px;
  padding-bottom: calc(5px + var(--safe-bottom));
  background: var(--color-bg); flex-shrink: 0; margin-bottom: 10px;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  max-height: 50dvh; overflow-y: auto; overflow-x: visible;
}

.input-group { display: flex; gap: 8px; overflow: visible; }

.message-input-wrapper { position: relative; flex: 1; display: flex; align-items: center; }

.avatar-selector { position: relative; display: flex; align-items: center; overflow: visible; }

.current-avatar {
  width: 45px; height: 45px; border-radius: var(--radius-round);
  overflow: hidden; cursor: pointer; border: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15); transition: all 0.3s;
}
.current-avatar:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.current-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-menu {
  position: fixed; bottom: 80px; left: 10px;
  background: var(--color-bg); border-radius: var(--radius-md); padding: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15); z-index: 10000; display: none;
  animation: fadeIn 0.3s ease;
}
.avatar-menu.show { display: block; }

.avatar-option {
  display: flex; align-items: center; padding: 6px 8px; border-radius: 10px;
  cursor: pointer; margin: 5px 0; transition: all 0.3s;
}
.avatar-option:hover { background: var(--color-accent-light); }
.avatar-option img { width: 35px; height: 35px; border-radius: var(--radius-round); margin-right: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.avatar-option span { font-weight: bold; }

.message-input {
  flex: 1; padding: 12px 75px 12px 15px; font-size: 1rem;
  border: none; border-radius: 30px; background: var(--color-bg);
  transition: box-shadow 0.3s; outline: none;
  box-shadow: var(--shadow-sm); font-family: var(--font-main);
  min-height: 50px; max-height: 200px; resize: none;
  overflow-y: auto; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap;
}
.message-input:focus { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.message-input::placeholder { color: #bcaaa4; font-style: italic; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Send & Options buttons */
.send-icon, .options-btn {
  position: absolute; color: var(--color-text-secondary); font-size: 1.2rem;
  cursor: pointer; transition: all 0.3s; z-index: 10;
}
.send-icon { right: 15px; }
.options-btn { right: 45px; }
.send-icon:hover, .options-btn:hover { color: #000; transform: scale(1.1); }
.send-icon:active, .options-btn:active { transform: scale(0.95); }
.send-icon.loading { color: #999; cursor: not-allowed; pointer-events: none; }
.options-btn.expanded { transform: rotate(45deg); color: #000; }

/* --- 10. Options Panel (legacy – now using modals) ----- */
.options-panel {
  background: var(--color-bg); border-radius: var(--radius-md); padding: 20px;
  margin-top: 15px; display: none; box-shadow: var(--shadow-sm);
}
.options-panel.show { display: block; animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.background-input {
  width: 100%; padding: 15px; font-size: 1rem; border: none; border-radius: var(--radius-md);
  min-height: 80px; max-height: 200px; resize: none; overflow-y: auto;
  background: var(--color-bg); margin-bottom: 15px; font-family: var(--font-main);
  box-shadow: var(--shadow-sm);
}
.background-input:focus { outline: none; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

.time-input {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  font-size: 0.9rem; background: var(--color-bg); font-family: var(--font-main);
  box-shadow: var(--shadow-sm);
}
.time-input:focus { outline: none; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

/* --- 11. Modals (shared & model modals) ---------------- */
.invite-modal, .phone-modal, .model-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.invite-modal-overlay, .phone-modal-overlay, .model-modal-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}

/* Generic modal content */
.modal-content {
  position: relative; background: var(--color-bg); z-index: 10001;
  animation: modalSlideIn 0.3s ease; box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.95) translateY(-20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Invite modal */
.invite-modal-content { border-radius: 20px; width: 90%; max-width: 400px; }
.invite-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #f0f0f0; }
.invite-modal-header h2 { margin: 0; font-size: 1.3rem; color: var(--color-text); display: flex; align-items: center; gap: 10px; }
.invite-modal-header h2 i { color: var(--color-accent); }
.invite-modal-body { padding: 20px; }

/* Phone modal */
.phone-modal-content { border-radius: 10px; width: 90%; max-width: 350px; padding: 30px 20px; }
.phone-modal-header { text-align: center; margin-bottom: 20px; }
.phone-modal-header i { font-size: 2rem; color: var(--color-text-secondary); margin-bottom: 10px; display: block; }
.phone-modal-header h2 { margin: 0; font-size: 1.2rem; color: var(--color-text); font-weight: 500; }
.phone-modal-body { text-align: center; }
.phone-modal-wechat { background: #f8f9fa; border-radius: var(--radius-sm); padding: 15px; margin: 15px 0; border: 1px solid #e9ecef; }
.phone-modal-wechat-label { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 8px; display: block; }
.phone-modal-wechat-id { font-size: 1.3rem; font-weight: 600; color: var(--color-text); letter-spacing: 1px; font-family: 'Courier New',monospace; user-select: text; cursor: text; }

/* Modal close buttons */
.invite-modal-close, .phone-modal-close, .model-modal-close {
  position: absolute; top: 10px; right: 10px;
  background: var(--color-bg-hover); border: none; font-size: 14px;
  color: var(--color-text-secondary); cursor: pointer;
  padding: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-round); transition: all 0.2s ease; z-index: 10;
}
.invite-modal-close:hover, .phone-modal-close:hover, .model-modal-close:hover { color: var(--color-text); }

/* --- 11b. Model Parameter Modals ----------------------- */
.model-modal-content { border-radius: 16px; width: 90%; max-width: 400px; }

.model-modal-header { text-align: center; padding: 15px 15px 10px; border-bottom: 1px solid #f0f0f0; }
.model-modal-avatar { width: 50px; height: 50px; border-radius: var(--radius-round); object-fit: cover; margin-bottom: 8px; border: 2px solid #f0f0f0; }
.model-modal-header h2 { margin: 0; font-size: 1rem; color: var(--color-text); font-weight: 500; }

.model-modal-body { padding: 15px; }
.model-modal-section { margin-bottom: 12px; }
.model-modal-section:last-child { margin-bottom: 0; }
.model-modal-section label { display: block; font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 8px; font-weight: 500; }
.model-modal-section label i { margin-right: 6px; color: var(--color-text-muted); }

.model-modal-footer { display: flex; gap: 10px; padding: 12px 15px; border-top: 1px solid #f0f0f0; }
.model-modal-btn { flex: 1; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; border: none; }
.model-modal-btn-cancel { background: var(--color-bg-hover); color: var(--color-text-secondary); }
.model-modal-btn-cancel:hover { background: #e8e8e8; }
.model-modal-btn-confirm { background: var(--color-accent); color: #fff; }
.model-modal-btn-confirm:hover { background: var(--color-accent-hover); }

/* Radio toggle rows (time-toggle, gender, mode) */
.radio-row { display: flex; gap: 8px; }
.radio-row .radio-option { flex: 1; position: relative; }
.radio-row .radio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-row .radio-option span {
  display: block; text-align: center; padding: 8px 12px;
  background: var(--color-bg-hover); border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--color-text-secondary);
  cursor: pointer; transition: all 0.2s ease;
}
.radio-row .radio-option input[type="radio"]:checked + span { background: var(--color-accent); color: #fff; }

/* Modal inputs */
.model-modal-body .background-input { padding: 10px; font-size: 0.9rem; min-height: 60px; border-radius: 10px; margin-bottom: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.model-modal-body .time-input { padding: 8px 10px; font-size: 0.9rem; border-radius: var(--radius-sm); margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* Native datetime input */
.datetime-input { font-family: var(--font-main); }
.datetime-input::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; opacity: 0.6; }
.datetime-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* --- 12. History Sidebar ------------------------------- */
#history-sidebar-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1999;
  display: none; opacity: 0; transition: opacity 0.3s;
}
#history-sidebar {
  position: fixed; top: 0; left: 0; margin: 0;
  width: 75%; max-width: 360px; height: 100%;
  background: var(--color-bg); padding: 20px; border-right: 1px solid var(--color-border);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1); z-index: 2000;
  transform: translateX(-100%); transition: transform 0.3s ease;
}
#history-modal-list { flex: 1; overflow-y: auto; padding-right: 10px; }

.history-item {
  padding: 4px 12px; cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.history-item:hover { background: var(--color-bg-hover); border-radius: 50px; }
.history-item::before { content: none; }

.history-list { max-height: 500px; overflow-y: auto; padding-right: 10px; }

.history-delete-btn {
  background: none; border: none; color: var(--color-text-muted);
  cursor: pointer; padding: 4px 8px; font-size: 0.85rem; margin-left: 4px; flex-shrink: 0;
}
.history-delete-btn:hover { color: var(--color-text-secondary); }

.history-title { font-weight: bold; margin-bottom: 8px; color: var(--color-text); display: flex; justify-content: space-between; }
.history-date { font-size: 0.85rem; color: var(--color-text-secondary); }
.history-preview { font-size: 0.95rem; color: var(--color-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.8rem; }
.model-tag { background: var(--color-text); color: var(--color-bg); padding: 2px 6px; border-radius: 10px; font-size: 0.7rem; }

/* --- 13. User Panel ------------------------------------ */
.user-header { text-align: center; padding: 20px 0; margin-bottom: 25px; }
.user-avatar-large {
  width: 100px; height: 100px; border-radius: var(--radius-round);
  border: 3px solid var(--color-border); margin: 0 auto 15px;
  overflow: hidden; background: var(--color-bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #9e9e9e;
}
.user-name { font-size: 1.5rem; font-weight: bold; color: var(--color-text); margin-bottom: 5px; font-family: var(--font-main); }

/* Quota display */
.quota-card {
  display: flex; align-items: center; padding: 12px 15px;
  background: var(--color-success); color: var(--color-bg); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); border: none; transition: all 0.3s ease; margin: 0 12px;
}
.quota-card i { font-size: 1.5rem; margin-right: 12px; width: 40px; text-align: center; }
.quota-info { flex: 1; }
.quota-title { font-weight: bold; font-size: 1rem; margin-bottom: 5px; }
.quota-count { font-size: 0.9rem; margin-bottom: 3px; }
.quota-days { font-size: 0.9rem; opacity: 0.9; }

.quota-section { margin-bottom: 15px; }
#user-quota-container { margin: 20px 0; width: 100%; }

/* --- 14. Login Form ------------------------------------ */
.login-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 200px); padding: 40px 20px; }
.login-title { font-size: 1.8rem; color: var(--color-text); margin-bottom: 40px; font-weight: 600; text-align: center; }
.login-options { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 320px; margin: 0 auto; }
.login-button {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 24px; border-radius: 12px; font-size: 1rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; border: none;
  background: var(--color-bg-hover); color: var(--color-text);
}
.login-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.login-button:active { transform: translateY(0); }
.login-button i { font-size: 1.2rem; }
.wechat-login { background: var(--color-wechat); color: var(--color-bg); }
.wechat-login:hover { background: #06ad56; box-shadow: 0 4px 12px rgba(7,193,96,0.3); }
.phone-login { background: var(--color-text); color: var(--color-bg); }
.phone-login:hover { background: #222; }
#skip-login { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
#skip-login:hover { background: #fafafa; color: var(--color-text-secondary); }

/* Account form */
.account-login-form { background: var(--color-bg); padding: 40px 30px; border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); max-width: 360px; margin: 0 auto; }
.account-login-form .login-title { font-size: 1.5rem; margin-bottom: 32px; }
.account-login-form .form-group { margin-bottom: 16px; }
.account-login-form .form-input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--color-border);
  border-radius: 10px; font-size: 1rem; transition: all 0.2s; background: #fafafa; box-sizing: border-box;
}
.account-login-form .form-input:focus { outline: none; border-color: var(--color-text); background: var(--color-bg); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.account-login-form .form-input::placeholder { color: #aaa; }
.account-login-form .submit-btn { width: 100%; padding: 14px; background: var(--color-text); color: var(--color-bg); border: none; border-radius: 10px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; margin-top: 8px; }
.account-login-form .submit-btn:hover { background: #222; }
.account-login-form .submit-btn:active { transform: scale(0.98); }
.account-login-form .switch-mode { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.account-login-form .switch-mode-text { color: #888; font-size: 0.9rem; }
.account-login-form .switch-mode-btn { color: var(--color-text); background: none; border: none; cursor: pointer; font-size: 0.9rem; font-weight: 500; padding: 0; margin-left: 5px; transition: color 0.2s; }
.account-login-form .switch-mode-btn:hover { color: var(--color-accent-hover); text-decoration: underline; }
.account-login-form .back-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; background: var(--color-bg-hover); color: var(--color-text-secondary); border: none; border-radius: 12px; font-size: 0.95rem; cursor: pointer; margin-top: 15px; transition: all 0.3s; }
.account-login-form .back-btn:hover { background: #eee; }
.input-with-icon { position: relative; }
.form-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 1rem; }
.input-with-icon .form-input { padding-left: 42px; }

/* --- 15. Intro Panel ----------------------------------- */
.intro-panel { padding: 8px 6px 80px; background: var(--color-bg); margin: 0; overflow: hidden; }
.intro-section { margin-bottom: 15px; padding: 12px; background: #f8f9fa; border-radius: 10px; border: 1px solid #e9ecef; }
.intro-section h2 { font-size: 1.3rem; color: var(--color-text); margin-bottom: 10px; font-family: var(--font-main); display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #dee2e6; padding-bottom: 5px; }
.intro-section h2 i { color: var(--color-text-secondary); font-size: 1.1rem; }

.model-intro { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.model-card { background: var(--color-bg); border-radius: 10px; padding: 12px; border: 1px solid #e9ecef; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 0; }
.model-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #e9ecef; cursor: pointer; }
.model-header:hover { opacity: 0.8; }
.model-collapse-btn { margin-left: auto; color: var(--color-text-secondary); font-size: 0.9rem; transition: transform 0.3s ease; flex-shrink: 0; }
.model-card.collapsed .model-collapse-btn { transform: rotate(-90deg); }
.model-content { overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; max-height: 2000px; opacity: 1; }
.model-card.collapsed .model-content { max-height: 0; opacity: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.model-avatar { width: 45px; height: 45px; border-radius: var(--radius-round); border: 2px solid #dee2e6; overflow: hidden; flex-shrink: 0; }
.model-avatar img { width: 100%; height: 100%; object-fit: cover; }
.model-name { font-size: 1.1rem; font-weight: bold; color: var(--color-text); font-family: var(--font-main); flex: 1; }
.model-tag { background: #6c757d; color: var(--color-bg); padding: 2px 6px; border-radius: 10px; font-size: 0.7rem; white-space: nowrap; }
.model-features { list-style: none; padding: 0; margin: 10px 0; }
.model-features li { padding: 5px 0; border-bottom: 1px dashed #e9ecef; color: var(--color-text); display: flex; align-items: flex-start; gap: 5px; font-size: 0.85rem; line-height: 1.4; }
.model-features li:last-child { border-bottom: none; }
.model-features li i { color: var(--color-text-secondary); width: 12px; font-size: 0.75rem; margin-top: 2px; flex-shrink: 0; }
.model-desc { color: var(--color-text-secondary); line-height: 1.4; font-size: 0.85rem; background: #f8f9fa; padding: 8px; border-radius: 5px; border-left: 3px solid #dee2e6; margin: 8px 0; }

.version-info { padding: 10px; border-radius: 6px; margin-bottom: 12px; font-size: 0.85rem; }
.version-info h3 { margin-bottom: 6px; font-size: 1rem; }
.version-info ul { padding-left: 16px; margin: 0; }

/* --- 16. Plans / Payment ------------------------------- */
.payment-section { margin: 0 12px; border-top: none; }
.plans-container { padding: 15px 10px; margin: 0 12px 30px; overflow-x: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; text-align: center; scrollbar-width: none; }
.plans-container::-webkit-scrollbar { display: none; }
.plans-container .plans-wrapper { display: inline-flex; flex-direction: row; gap: 12px; width: fit-content; }
.grid-packages-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding: 0 20px 30px; margin: 0 20px; }
.grid-packages-container .single-purchase { background: var(--color-bg); border-radius: var(--radius-md); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.grid-packages-container .single-purchase h3 { font-size: 1.1rem; color: var(--color-text); margin-bottom: 10px; }
.grid-packages-container .single-price { font-size: 1.5rem; font-weight: bold; color: #ff6600; margin-bottom: 15px; }

.plan-card { position: relative; flex: 0 0 190px; min-height: 200px; padding: 16px; background: var(--color-accent-light); border-radius: var(--radius-md); text-align: center; scroll-snap-align: center; transition: transform 0.3s ease; }
.plan-card.center-card { transform: scale(1.05); z-index: 10; }
.plan-card.popular { overflow: hidden; }
.plan-card.popular::before { content: '推荐'; position: absolute; top: 8px; right: -32px; background: var(--color-accent); color: var(--color-bg); padding: 2px 32px; font-size: 0.65rem; font-weight: bold; transform: rotate(45deg); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.plan-name { font-size: 1.2rem; font-weight: bold; color: var(--color-text); margin-bottom: 10px; }
.plan-price { font-size: 1.8rem; font-weight: bold; color: #ff6600; margin-bottom: 15px; }
.plan-price small { font-size: 1rem; color: #8d6e63; }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; min-height: 72px; }
.plan-features li { padding: 8px 0; border-bottom: 1px dashed #ffcc80; color: var(--color-text); }
.plan-features li:last-child { border-bottom: none; }
.plan-description { font-size: 0.8rem; color: #888; margin: 12px 0 16px; line-height: 1.4; padding: 0 4px; }

.buy-button { width: 100%; padding: 10px 20px; background: var(--color-text); color: var(--color-bg); border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.3s; min-height: 44px; }
.buy-button:hover { background: #000; opacity: 0.9; }

.single-purchase { background: var(--color-bg-hover); border-radius: var(--radius-md); padding: 20px; text-align: center; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.single-purchase:last-child { margin-bottom: 0; }
.single-price { font-size: 1.5rem; font-weight: bold; color: #ff6600; margin: 15px 0; }
.quantity-selector { display: flex; justify-content: center; align-items: center; gap: 15px; margin: 20px 0; }
.quantity-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--color-text); color: var(--color-bg); border: none; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; min-width: 44px; min-height: 44px; }
.quantity-btn:hover { background: #000; }
.quantity-display { font-size: 1.3rem; font-weight: bold; min-width: 50px; text-align: center; }
.total-price { font-size: 1.3rem; margin: 15px 0; font-weight: bold; color: var(--color-text); }

/* --- 17. Misc Components ------------------------------- */
.typing-indicator { display: flex; align-items: center; justify-content: center; padding: 15px; background: var(--color-accent-light); border-radius: 20px; width: fit-content; margin: 10px auto 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.typing-dot { width: 10px; height: 10px; background: var(--color-accent); border-radius: var(--radius-round); margin: 0 4px; animation: bounce 1.5s infinite ease-in-out; }
.typing-dot:nth-child(2){ animation-delay: 0.2s; }
.typing-dot:nth-child(3){ animation-delay: 0.4s; }

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

.time-section { background: var(--color-bg); border-radius: var(--radius-md); padding: 15px; box-shadow: var(--shadow-sm); }
.time-section h3 { color: var(--color-danger); margin-bottom: 10px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; font-family: var(--font-main); }
.time-choices { display: flex; gap: 15px; margin-bottom: 10px; flex-wrap: wrap; }

/* Time slider */
.time-slider-group { margin-bottom: 15px; padding: 10px 0; }
.time-slider-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--color-text); font-size: 0.85rem; }
.time-slider-group label span { color: var(--color-danger); font-weight: bold; margin-left: 5px; }
.time-slider { width: 100%; height: 8px; border-radius: 4px; background: #ffcc80; outline: none; -webkit-appearance: none; appearance: none; }
.time-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: var(--radius-round); background: var(--color-accent); cursor: pointer; border: 2px solid var(--color-bg); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.time-slider::-webkit-slider-track { height: 8px; border-radius: 4px; background: var(--color-danger); }
.time-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: var(--radius-round); background: var(--color-accent); cursor: pointer; border: 2px solid var(--color-bg); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.time-slider::-moz-range-track { height: 8px; border-radius: 4px; background: var(--color-danger); border: none; }

/* Options confirm */
.options-confirm-section { text-align: center; margin-top: 20px; padding-top: 15px; border-top: 1px dashed #ffcc80; }
.confirm-options-button { background: var(--color-success); color: var(--color-bg); border: none; padding: 10px 25px; border-radius: var(--radius-lg); font-size: 0.9rem; font-weight: bold; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 15px rgba(76,175,80,0.3); display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; }
.confirm-options-button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76,175,80,0.4); }
.confirm-options-button:active { transform: translateY(0); }

/* Loading overlay */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.loading-overlay.active { opacity: 1; pointer-events: all; }
.loading-content { text-align: center; background: var(--color-bg); padding: 30px; border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: 1px solid var(--color-border); max-width: 300px; width: 100%; }
.loading-spinner { width: 60px; height: 60px; border: 5px solid var(--color-border); border-top-color: var(--color-text); border-radius: var(--radius-round); margin: 0 auto 20px; animation: spin 1s linear infinite; }
.loading-text { font-size: 1.2rem; color: var(--color-text); font-weight: bold; }

/* Nav item */
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--color-text-secondary); font-size: 0.9rem; cursor: pointer; transition: all 0.3s; position: relative; padding: 8px 0; min-height: 55px; }
.nav-item i { font-size: 1.2rem; margin-bottom: 3px; }
.nav-item:hover { color: var(--color-text); }
.nav-item.active { color: var(--color-text); }
.nav-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60%; height: 2px; background: var(--color-text); border-radius: 2px; }

/* Refresh quota button */
.refresh-quota-btn { position: relative; outline: none; flex-shrink: 0; min-width: 36px; min-height: 36px; }
.refresh-quota-btn:active { transform: scale(0.96) !important; }
.refresh-quota-btn i { transition: transform 0.4s cubic-bezier(0.68,-0.55,0.265,1.55); }
.refresh-quota-btn:active i { transform: rotate(180deg); }

/* Wechat login button */
.wechat-login-btn { background: var(--color-wechat); color: var(--color-bg); border: none; padding: 10px 20px; border-radius: 20px; margin-top: 15px; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; transition: all 0.3s; min-height: 44px; }
.wechat-login-btn:hover { background: #00b42a; transform: translateY(-2px); }
.wechat-login-btn.integrated:hover { background: #06a050; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(7,193,96,0.35); }
.logout-btn.integrated:hover { background: #d32f2f; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(244,67,54,0.35); }

/* Touch / accessibility */
button, .nav-item, .avatar-option, .plan-card, .history-item, .current-avatar { cursor: pointer; }
button, .nav-item, .avatar-option { -webkit-touch-callout: none; user-select: text;-webkit-user-select: text; user-select: none; }

/* --- 18. Prevent iOS zoom on focus --------------------- */
.datetime-input { font-size: 16px; }

/* --- 19. User Panel Detail Sections -------------------- */
.quota-detail-section {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  margin: 20px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.quota-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}
.quota-detail-header h3 {
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
}
.quota-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.detail-item {
  text-align: center;
}
.detail-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  font-size: 0.85rem;
}
.detail-value {
  color: #FF6B6B;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Expiration warning */
.expiration-warning {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 15px 0;
}
.expiration-warning-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.expiration-warning-inner i {
  color: #ff9800;
  font-size: 1.2rem;
}
.expiration-warning-title {
  color: #e65100;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.expiration-warning-text {
  color: #e65100;
  font-size: 0.85rem;
}

/* Progress bar */
.usage-progress {
  margin-top: 20px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #333;
}
.progress-bar {
  height: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #4ECDC4;
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* Refresh quota button */
.refresh-quota-btn {
  width: 36px; height: 36px;
  min-width: 36px; min-height: 36px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 2px 6px rgba(76,175,80,0.25);
}
.refresh-quota-btn:active { transform: scale(0.96); }
.refresh-quota-btn i { transition: transform 0.4s cubic-bezier(0.68,-0.55,0.265,1.55); }
.refresh-quota-btn:active i { transform: rotate(180deg); }

/* --- 20. Modals without overlay (clean cards) ---------- */
.modal-no-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  width: 88%;
  max-width: 360px;
  z-index: 10001;
  animation: modalSlideIn 0.25s ease;
}
.modal-card-close {
  position: absolute;
  top: 12px; right: 12px;
  background: #f5f5f5;
  border: none;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.2s;
}
.modal-card-close:hover { background: #e8e8e8; }

/* Activation code modal */
.invite-modal-content {
  padding: 24px 20px 20px;
}
.invite-modal-content .invite-modal-header {
  text-align: center;
  padding: 20px 0 16px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}
.invite-modal-content .invite-modal-header i {
  font-size: 1.5rem;
  color: #ff9800;
  margin-bottom: 8px;
  display: block;
}
.invite-modal-content .invite-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
}
.invite-modal-content .invite-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.invite-modal-content .invite-input:focus {
  border-color: #ff9800;
}
.invite-modal-content .invite-input::placeholder { color: #bbb; }
.invite-modal-content .invite-modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 16px;
}
.invite-modal-content .invite-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.invite-btn-cancel {
  background: #f5f5f5;
  color: #666;
}
.invite-btn-cancel:hover { background: #e8e8e8; }
.invite-btn-confirm {
  background: #ff9800;
  color: #fff;
}
.invite-btn-confirm:hover { background: #f57c00; }
.invite-btn-confirm:disabled { opacity: 0.6; cursor: not-allowed; }

/* Invite message */
.invite-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: center;
  color: #e57373;
  background: rgba(229,115,115,0.08);
}
.invite-msg.success {
  color: #4CAF50;
  background: rgba(76,175,80,0.08);
}

/* --- 21. User Menu Items (clean) ----------------------- */
.user-menu {
  width: 100%;
  max-width: 360px;
  padding: 0;
  margin: 8px auto 0;
}
.menu-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin: 8px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.menu-item-card:active {
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  background: #fafafa;
}
.menu-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-item-left i {
  font-size: 1.1rem;
  color: #666;
  width: 24px;
  text-align: center;
}
.menu-item-left span {
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
}
.menu-arrow {
  font-size: 0.8rem;
  color: #ccc;
}

/* --- 22. User Panel Layout Overrides ------------------- */
#user-panel .container {
  background: #f8f9fa;
  min-height: 100vh;
  padding-bottom: 100px;
}
#user-panel header {
  background: #fff;
}
#user-panel .user-avatar-large {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid #e0e0e0;
  margin: 0 auto 12px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #9e9e9e;
}
#user-panel .user-header {
  text-align: center;
  padding: 24px 0 8px;
}
#user-panel .user-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.user-id {
  font-size: 0.8rem;
  color: #999;
}

/* User action buttons (WeChat + Logout) */
.user-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.user-actions .btn-wechat {
  background: #07C160;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(7,193,96,0.2);
}
.user-actions .btn-logout {
  background: #f44336;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(244,67,54,0.2);
}

/* No quota card */
.no-quota-card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  margin: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.no-quota-card i {
  font-size: 1.4rem;
  color: #ff9800;
}
.no-quota-card .no-quota-info {
  flex: 1;
}
.no-quota-card .no-quota-title {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}
.no-quota-card .no-quota-desc {
  font-size: 0.85rem;
  color: #999;
}

/* Login form inside user panel */
.account-login-form-panel {
  background: #fff;
  padding: 32px 24px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 16px;
}

/* --- 23. Package Payment in User Panel ----------------- */
.payment-section {
  margin: 16px 0;
}
.payment-section .section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  padding: 0 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plans-container {
  padding: 0 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.plans-container::-webkit-scrollbar { display: none; }
.plans-container .plans-wrapper {
  display: inline-flex;
  flex-direction: row;
  gap: 12px;
  width: fit-content;
}
.grid-packages-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px;
  margin: 16px 0;
}
.single-purchase-card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.single-purchase-card h3 {
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 8px;
}
.single-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff6600;
  margin-bottom: 12px;
}
.quantity-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 16px 0;
}
.quantity-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; min-height: 36px;
}
.quantity-btn:hover { background: #000; }
.quantity-display {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}
.total-price {
  font-size: 1.2rem;
  margin: 12px 0;
  font-weight: 600;
  color: #333;
}
.buy-btn {
  width: 100%;
  padding: 12px 20px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}
.buy-btn:hover { background: #000; }
.buy-btn:disabled { opacity: 0.6; cursor: not-allowed; }
