/* form helpers (share page) */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}

.auth-error.show {
  display: block;
}

/* Drive */
.drive-layout {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.drive-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.drive-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drive-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.drive-main {
  padding: 32px 0 64px;
}

.drive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.drive-toolbar h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-card);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  margin-bottom: 24px;
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.05);
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.upload-zone .hint {
  font-size: 0.8rem;
  margin-top: 8px;
  opacity: 0.7;
}

.upload-progress {
  display: none;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.upload-progress.show {
  display: block;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.3s;
  width: 0%;
}

.file-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th,
.file-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.file-table th {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

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

.file-table tr:hover td {
  background: rgba(56, 189, 248, 0.03);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-name-cell span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  width: min(480px, 100%);
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.modal h3 {
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.share-result {
  display: none;
  margin-top: 16px;
  padding: 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
}

.share-result.show {
  display: block;
}

.share-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent);
  margin: 8px 0;
}

/* Share page */
.share-layout {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.share-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.share-header-inner {
  display: flex;
  align-items: center;
}

.share-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.share-card {
  width: min(520px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: center;
}

.share-file-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.share-card h1 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  word-break: break-all;
}

.share-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* iOS distribution */
.ios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ios-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.ios-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.ios-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.ios-mode-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.ios-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.ios-pricing-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.ios-pricing-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ios-mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.ios-mode-card {
  display: block;
  cursor: pointer;
}

.ios-mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ios-mode-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}

.ios-mode-card input:checked + .ios-mode-card-body {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.ios-mode-card-body strong {
  font-size: 0.92rem;
}

.ios-mode-card-body span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ios-cert-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.ios-cert-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ios-upload {
  margin-top: 0;
}

.ios-cert-list {
  list-style: none;
  margin-top: 20px;
  padding: 0;
}

.ios-cert-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.ios-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-top: 12px;
}

.ios-install-tips {
  margin-top: 24px;
  text-align: left;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.ios-install-tips p {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.ios-install-tips ol {
  margin: 0 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.install-progress {
  margin-top: 24px;
  text-align: left;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.install-progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.install-progress-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.install-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.install-progress-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.install-progress-steps li .step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.install-progress-steps li.active {
  color: var(--text);
  font-weight: 500;
}

.install-progress-steps li.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  animation: install-pulse 1.2s ease-in-out infinite;
}

.install-progress-steps li.done {
  color: var(--text);
}

.install-progress-steps li.done .step-dot {
  border-color: #22c55e;
  background: #22c55e;
}

.install-progress-note {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

@keyframes install-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (max-width: 900px) {
  .ios-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success {
  border-color: rgba(52, 211, 153, 0.4);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.billing-section-title {
  margin: 32px 0 8px;
  font-size: 1.25rem;
}

.billing-section-desc {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.usage-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.usage-card p {
  margin: 6px 0;
  font-size: 0.9rem;
}

.usage-meta {
  color: var(--text-muted);
  font-size: 0.85rem !important;
}

.usage-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.billing-topups {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.billing-topup-card {
  text-align: center;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-modal.hidden {
  display: none;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.qr-modal-card {
  position: relative;
  background: var(--card-bg, #1a1f2e);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.qr-modal-card h3 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.qr-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.qr-modal-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  margin: 12px 0;
}

.install-qr-wrap {
  margin: 20px auto 0;
  text-align: center;
}

.install-qr-wrap canvas {
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.install-qr-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.wallet-qr-wrap {
  margin-top: 12px;
  text-align: center;
}

.wallet-qr-wrap canvas {
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-modal.hidden {
  display: none;
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.media-modal-card {
  position: relative;
  width: min(720px, calc(100% - 32px));
  background: var(--card-bg, #1a1f2e);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.media-modal-card h3 {
  margin-bottom: 16px;
  font-size: 1rem;
  word-break: break-all;
}

.media-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.media-player-wrap,
.media-inline-player {
  width: 100%;
}

.media-player-video {
  width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  background: #000;
}

.media-player-audio {
  width: 100%;
  margin-top: 8px;
}

.media-inline-player {
  margin: 16px 0 8px;
}

.app-icon-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.billing-page {
  max-width: 960px;
}

.billing-header {
  margin-bottom: 24px;
}

.billing-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.billing-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.card-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.billing-current-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.billing-current-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.billing-current-expire {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.billing-plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.billing-plan-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.billing-plan-card.featured {
  border-color: rgba(56, 189, 248, 0.4);
}

.billing-plan-price {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0 16px;
}

.billing-plan-price span {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
}

.billing-order.hidden {
  display: none;
}

.billing-order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.billing-order-grid .full {
  grid-column: 1 / -1;
}

.billing-order-grid .label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.billing-order-grid .amount {
  color: var(--accent);
  font-weight: 700;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wallet-row code {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.billing-notice {
  padding: 16px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.billing-notice p + p {
  margin-top: 6px;
}

.billing-tx-form {
  max-width: 480px;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

.status-pending { color: var(--warning); border-color: rgba(251, 191, 36, 0.3); }
.status-paid { color: var(--accent); border-color: rgba(56, 189, 248, 0.3); }
.status-confirmed { color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.status-rejected, .status-expired { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }

@media (max-width: 768px) {
  .billing-plans {
    grid-template-columns: 1fr;
  }

  .billing-order-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .file-table-wrap {
    overflow-x: auto;
  }

  .file-table {
    min-width: 600px;
  }
}

/* 微信内置浏览器引导 */
.wechat-guide-active {
  overflow: hidden;
}

.wechat-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px 24px;
}

.wechat-guide-arrow {
  position: fixed;
  top: 12px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-top: 3px solid #fbbf24;
  border-right: 3px solid #fbbf24;
  transform: rotate(-45deg);
  animation: wechatGuidePulse 1.2s ease-in-out infinite;
}

.wechat-guide-card {
  width: min(420px, 100%);
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.wechat-guide-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.wechat-guide-card h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.wechat-guide-card p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.wechat-guide-tip {
  font-size: 0.84rem !important;
  margin-bottom: 18px !important;
}

.wechat-guide-blocked {
  pointer-events: none;
  opacity: 0.45;
}

@keyframes wechatGuidePulse {
  0%, 100% { opacity: 0.55; transform: rotate(-45deg) translate(0, 0); }
  50% { opacity: 1; transform: rotate(-45deg) translate(4px, -4px); }
}
