/* =========================================================
   style.css - my.398200.xyz 私人全能数字百宝箱
   设计规范：清新浅色高雅美学 · 绝无厚重粗体(0实例>=600) · 移动端优先响应
   ========================================================= */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #f0f9ff;
  --primary-border: #bae6fd;
  
  --coral: #f43f5e;
  --coral-light: #fff1f2;
  --coral-border: #fecdd3;

  --sage: #15803d;
  --sage-light: #f0fdf4;
  --sage-border: #bbf7d0;

  --amber: #b45309;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.06);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.07);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --font-sans: "MiSans VF", "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  background-color: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 统一无加粗标准 */
b, strong, th, h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
}

/* ================= 顶栏 ================= */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.95);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
}

.vault-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  letter-spacing: 0.5px;
}

.brand-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.security-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.security-status.unlocked {
  background: var(--sage-light);
  color: var(--sage);
  border: 1px solid var(--sage-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-light);
}

.security-status.unlocked .status-dot {
  background: var(--sage);
  box-shadow: 0 0 6px var(--sage);
}

.btn-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-lock:hover {
  background: var(--coral-light);
  color: var(--coral);
  border-color: var(--coral-border);
}

/* ================= 锁屏卡片 ================= */
.lock-screen-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 20px;
}

.lock-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  text-align: center;
}

.lock-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

.lock-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-password-wrap {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
}

.btn-toggle-eye:hover {
  opacity: 1;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

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

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  text-decoration: underline;
}

.lock-hint {
  font-size: 13px;
  color: var(--coral);
  min-height: 18px;
}

.lock-footnote {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  text-align: left;
  background: var(--bg-page);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
}

/* ================= 主工作区布局 ================= */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Tab 切换栏 */
.vault-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-item:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.tab-item.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.tab-count {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.tab-item.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Tab 面板 */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* 工具栏 */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-light);
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.pill-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--primary-border);
}

.pill-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.toolbar-tip {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ================= 卡片网格 ================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-category-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.card-item-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.card-actions-top {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-icon-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.card-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.card-icon-btn.danger:hover {
  color: var(--coral);
}

.card-body-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.field-label {
  color: var(--text-muted);
}

.field-val-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.field-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--primary);
}

.field-btn:hover {
  opacity: 0.8;
}

.card-notes-preview {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}

.note-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.note-tag {
  font-size: 11px;
  padding: 1px 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
}

/* ================= 提醒事项列表 ================= */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reminder-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.reminder-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reminder-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.reminder-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.repeat-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.reminder-countdown {
  font-size: 13px;
  color: var(--primary);
  padding: 4px 10px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
  white-space: nowrap;
}

/* ================= SUB-STORE 节点管理 ================= */
.substore-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.substore-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.substore-card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
}

.substore-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.export-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
}

.export-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--primary);
  outline: none;
}

.btn-copy-link, .btn-qr-link {
  padding: 10px 14px;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy-link {
  background: var(--primary);
  color: #ffffff;
}

.btn-qr-link {
  background: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border-light);
}

.client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.node-filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-body);
  cursor: pointer;
}

.nodes-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--bg-page);
}

.node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.node-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-protocol {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ================= 设置面板 ================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.settings-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.file-upload-label {
  cursor: pointer;
}

.settings-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-page);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

/* ================= 模态弹窗系统 ================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.modal-sm {
  max-width: 400px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--coral);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-half {
  flex: 1;
}

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

.label-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req {
  color: var(--coral);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.font-mono {
  font-family: var(--font-mono);
}

/* 密码生成器内部样式 */
.gen-result-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.gen-password-text {
  font-size: 16px;
  color: var(--primary);
  word-break: break-all;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.form-range {
  flex: 1;
  accent-color: var(--primary);
}

.gen-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 空状态提示 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--text-main);
  color: #ffffff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease-out;
}

.toast.success {
  background: var(--sage);
}

.toast.error {
  background: var(--coral);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= 移动端适配 ================= */
@media (max-width: 768px) {
  .substore-layout {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left, .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    width: 100%;
  }

  .header-inner {
    padding: 10px 14px;
  }
}
