/* ========== Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background: #faf7f2;
  color: #4a3b2e;
  min-height: 100vh;
}

/* ========== Navbar ========== */
.navbar {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212,163,115,0.1);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; height: 56px; gap: 0.5rem; }
.nav-brand {
  color: #d4a373;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 1px;
}
.nav-links { display: flex; gap: 0.25rem; flex: 1; justify-content: center; }
.nav-links a {
  color: rgba(74,59,46,0.5);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(212,163,115,0.1);
  color: #d4a373;
}
.nav-user { display: flex; gap: 0.5rem; align-items: center; }
.nav-user a {
  color: rgba(74,59,46,0.5);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-user a:hover { background: rgba(212,163,115,0.1); color: #d4a373; }

/* ========== Container ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ========== Auth ========== */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.03);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; color: #d4a373; }
.auth-subtitle { color: rgba(74,59,46,0.3); margin-bottom: 1.5rem; }
.auth-link { margin-top: 1rem; font-size: 0.9rem; color: rgba(74,59,46,0.3); }
.auth-link a { color: #d4a373; text-decoration: none; }

/* ========== Forms ========== */
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 500; font-size: 0.9rem; color: rgba(74,59,46,0.6); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: rgba(255,255,255,0.4);
  border: 1.5px solid rgba(212,163,115,0.12);
  border-radius: 10px;
  font-size: 0.95rem;
  color: #4a3b2e;
  transition: all 0.25s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  background: rgba(255,255,255,0.75);
  border-color: #d4a373;
  box-shadow: 0 0 0 3px rgba(212,163,115,0.08);
}
.form-group textarea { resize: vertical; }
.form-row { display: flex; gap: 0.75rem; }
.form-row .form-group { flex: 1; }
.help-text { font-size: 0.8rem; color: rgba(74,59,46,0.3); margin-top: 0.25rem; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border: none; border-radius: 10px;
  font-size: 0.9rem; cursor: pointer; text-decoration: none;
  transition: all 0.25s ease;
}
.btn-primary {
  background: #d4a373;
  color: white;
  box-shadow: 0 4px 12px rgba(212,163,115,0.18);
}
.btn-primary:hover { background: #c49264; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212,163,115,0.25); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(212,163,115,0.2);
  color: rgba(74,59,46,0.5);
}
.btn-outline:hover { background: rgba(212,163,115,0.06); border-color: #d4a373; color: #d4a373; }
.btn-danger {
  background: #e74c3c;
  color: white;
  box-shadow: 0 4px 12px rgba(231,76,60,0.15);
}
.btn-danger:hover { background: #c0392b; transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ========== Alerts ========== */
.alert { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(231,76,60,0.06); border: 1px solid rgba(231,76,60,0.1); color: #c0392b; }
.alert-success { background: rgba(46,204,113,0.06); border: 1px solid rgba(46,204,113,0.1); color: #27ae60; }

/* ========== Dashboard ========== */
.welcome-card {
  background: linear-gradient(135deg, rgba(212,163,115,0.12) 0%, rgba(180,130,80,0.06) 100%);
  border: 1px solid rgba(212,163,115,0.08);
  color: #4a3b2e;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
}
.welcome-card h2 { font-family: 'ZCOOL KuaiLe', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-weight: 400; }
.welcome-card .text-muted { color: rgba(74,59,46,0.35); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(212,163,115,0.1);
  color: #d4a373;
}
.stat-number { display: block; font-size: 1.5rem; font-weight: 700; color: #4a3b2e; }
.stat-label { color: rgba(74,59,46,0.35); font-size: 0.85rem; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-section {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h3 { font-size: 1rem; color: #4a3b2e; }

/* ========== Page Header ========== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.page-header h2 { font-size: 1.3rem; color: #4a3b2e; }
.header-actions { display: flex; gap: 0.5rem; }

/* ========== Photos ========== */
.photo-grid-sm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-thumb-sm { aspect-ratio: 4/3; overflow: hidden; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); background: rgba(212,163,115,0.04); }
.photo-thumb-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ========== 炫酷相册卡片（新版） ========== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.album-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow:
    0 4px 20px rgba(74,59,46,0.10),
    0 0 0 1px rgba(255,255,255,0.5) inset;
  cursor: pointer;
  perspective: 600px;
  -webkit-perspective: 600px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* 渐变流光边框 */
.album-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(212,163,115,0.15) 60deg,
    rgba(180,130,80,0.08) 120deg,
    transparent 180deg,
    rgba(56,189,248,0.1) 240deg,
    rgba(168,85,247,0.08) 300deg,
    transparent 360deg
  );
  -webkit-background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(212,163,115,0.15) 60deg,
    rgba(180,130,80,0.08) 120deg,
    transparent 180deg,
    rgba(56,189,248,0.1) 240deg,
    rgba(168,85,247,0.08) 300deg,
    transparent 360deg
  );
  z-index: -1;
  pointer-events: none;
}

/* 内部毛玻璃遮罩（盖住流光，只露边框） */
.album-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.2));
  z-index: -1;
}
.album-card:hover {
  box-shadow:
    0 20px 40px rgba(212,163,115,0.12),
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 0 30px rgba(212,163,115,0.06);
}

/* 封面区（高度增加，可容纳更好效果） */
.album-cover {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* 底部渐隐遮罩 */
.album-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.06) 100%);
  z-index: 1;
  will-change: transform;
}
/* 动态水波纹光晕 */
.album-cover::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    circle at 30% 40%,
    rgba(255,255,255,0.2) 0%,
    rgba(255,255,255,0.05) 20%,
    transparent 50%
  );
  z-index: 1;
  will-change: transform;
  pointer-events: none;
}


/* 封面图标 */
.album-cover .cover-icon {
  font-size: 3.2rem;
  opacity: 0.5;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
  z-index: 2;
}

/* 照片数量徽章 */
.album-cover .photo-count-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  color: rgba(74,59,46,0.55);
  font-weight: 500;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,255,255,0.3);
  letter-spacing: 0.3px;
}

/* 相册信息区 */
.album-info {
  padding: 1rem 1.1rem 1.1rem;
  position: relative;
}
.album-info h4 {
  margin: 0 0 3px 0;
  font-size: 1rem;
  font-weight: 700;
  color: #4a3b2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.album-info .album-meta {
  font-size: 0.78rem;
  color: rgba(74,59,46,0.3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.album-info .album-meta i {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* 操作按钮（hover才显示，带渐入动效） */
.album-info .album-actions {
  position: absolute;
  bottom: 0.7rem;
  right: 0.8rem;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.25s ease;
}
.album-card:hover .album-actions {
  opacity: 1;
  transform: translateY(0);
}
.album-info .album-actions form button,
.album-info .album-actions button {
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(212,163,115,0.1);
  border-radius: 8px;
  color: rgba(74,59,46,0.35);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.album-info .album-actions form button:hover,
.album-info .album-actions button:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(212,163,115,0.2);
  color: #4a3b2e;
}
.album-info .album-actions form button[type="submit"]:hover {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.15);
  background: rgba(231,76,60,0.04);
}

/* 各卡片封面渐变底色（循环6色） */
.album-card:nth-child(6n+1) .album-cover { background: linear-gradient(135deg, rgba(56,189,248,0.1), rgba(56,189,248,0.03)); }
.album-card:nth-child(6n+2) .album-cover { background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(168,85,247,0.03)); }
.album-card:nth-child(6n+3) .album-cover { background: linear-gradient(135deg, rgba(251,146,60,0.1), rgba(251,146,60,0.03)); }
.album-card:nth-child(6n+4) .album-cover { background: linear-gradient(135deg, rgba(52,211,153,0.1), rgba(52,211,153,0.03)); }
.album-card:nth-child(6n+5) .album-cover { background: linear-gradient(135deg, rgba(244,63,94,0.1), rgba(244,63,94,0.03)); }
.album-card:nth-child(6n+6) .album-cover { background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(251,191,36,0.03)); }


/* 照片网格 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.photo-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(74,59,46,0.04);
}
.photo-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.photo-info { padding: 0.75rem; }
.photo-name { display: block; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4a3b2e; }
.photo-meta { display: block; font-size: 0.75rem; color: rgba(74,59,46,0.35); margin: 0.25rem 0; }
.photo-date {
  background: rgba(212,163,115,0.08);
  color: #d4a373;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ========== Stocks ========== */
.stock-controls { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.stock-table {
  width: 100%;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
  border-collapse: collapse;
}
.stock-table th { background: rgba(212,163,115,0.06); padding: 0.75rem 1rem; text-align: left; font-size: 0.85rem; color: rgba(74,59,46,0.5); }
.stock-table td { padding: 0.75rem 1rem; border-top: 1px solid rgba(212,163,115,0.06); font-size: 0.9rem; }
.stock-table tr:hover { background: rgba(212,163,115,0.03); }

/* ========== Messages ========== */
.msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .msg-grid { grid-template-columns: 1fr; } }
.msg-section {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}
.msg-section h3 { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; color: #4a3b2e; }
.badge { background: #e74c3c; color: white; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.msg-item { display: block; padding: 0.75rem; border-radius: 8px; margin-bottom: 4px; text-decoration: none; color: inherit; }
.msg-item:hover { background: rgba(212,163,115,0.06); }
.msg-item.unread { background: rgba(212,163,115,0.08); font-weight: 600; }
.msg-from { font-size: 0.8rem; color: #d4a373; }
.msg-subject { margin: 0.15rem 0; }
.msg-time { font-size: 0.75rem; color: rgba(74,59,46,0.35); }

/* ========== Events ========== */
.event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #d4a373;
  margin-bottom: 0.4rem;
  background: rgba(255,255,255,0.4);
  border-radius: 0 8px 8px 0;
}
.event-time { font-size: 0.8rem; color: rgba(74,59,46,0.5); min-width: 45px; }
.event-title { font-size: 0.9rem; }

/* ========== Modal ========== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); z-index: 200; align-items: center; justify-content: center; }
.modal-content {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.close { position: absolute; top: 0.75rem; right: 1rem; font-size: 1.5rem; cursor: pointer; color: rgba(74,59,46,0.3); line-height: 1; }
.close:hover { color: #4a3b2e; }

/* ========== Utils ========== */
.empty-state { text-align: center; padding: 3rem 1rem; grid-column: 1 / -1; }
.empty-state i { color: rgba(74,59,46,0.15); margin-bottom: 1rem; }
.empty-state p { color: rgba(74,59,46,0.3); }
.empty-text { color: rgba(74,59,46,0.3); text-align: center; padding: 1rem; }
.text-muted { color: rgba(74,59,46,0.35); font-size: 0.85rem; }
.small { font-size: 0.8rem; }
.loading { text-align: center; padding: 2rem; color: rgba(74,59,46,0.3); }

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .nav-links a { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-user a span { display: none; }
}