:root {
  --gold: #c8a04d;
  --gold-light: #f7e8b5;
  --gold-dark: #8f6b1c;
  --bg: #f9f5e9;
  --card-bg: #fff;
  --text: #333;
  --text-light: #666;
  --border: #e5d9b6;
  --accent: #d4a03d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px;
}

.page-admin {
  background: #f4f4f4;
}

/* 首页头部 */
.site-header {
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(180deg, #fff 0%, var(--gold-light) 100%);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.title {
  font-size: 26px;
  color: var(--gold-dark);
  margin: 0 0 10px;
  font-weight: 700;
}

.header-info {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}

.header-info br {
  line-height: 1.8;
}

.update-time {
  font-size: 13px;
  color: var(--text-light);
}

/* 价格表格 */
.price-board {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 12px;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  table-layout: fixed;
}

.price-table th:nth-child(1),
.price-table td:nth-child(1) {
  width: 35%;
}

.price-table th:nth-child(2),
.price-table td:nth-child(2) {
  width: 30%;
}

.price-table th:nth-child(3),
.price-table td:nth-child(3) {
  width: 35%;
}

.price-table thead {
  background: var(--gold);
  color: #fff;
}

.price-table th,
.price-table td {
  padding: 10px 8px;
  text-align: center;
}

.price-table tbody tr:nth-child(even) {
  background: #fffbf0;
}

.metal-name {
  font-weight: 600;
}

.metal-code {
  font-size: 13px;
  color: var(--text-light);
}

.metal-price {
  font-size: 19px;
  font-weight: 700;
  color: #c9302c;
}

.metal-time {
  font-size: 14px;
  color: var(--text-light);
}

/* 通知、业务、联系 */
.notice,
.about,
.contact {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-size: 14px;
}

.notice {
  color: #8f6b1c;
  background: #fff9e6;
}

.about h2,
.contact h2 {
  font-size: 20px;
  color: var(--gold-dark);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
}

.about p,
.contact p {
  margin: 0 0 8px;
}

.site-footer {
  text-align: center;
  padding: 20px 0;
}

.admin-link {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: none;
}

.admin-link:hover {
  color: var(--gold-dark);
}

/* 后台 */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #333;
  color: #fff;
  padding: 0 16px;
  height: 56px;
}

.nav-brand {
  font-weight: 700;
  color: var(--gold);
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--gold);
}

.admin-main {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 16px;
}

.admin-main h1 {
  font-size: 22px;
  margin-bottom: 16px;
}

.panel {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.panel h2 {
  font-size: 16px;
  margin: 0 0 14px;
  color: var(--gold-dark);
  border-left: 4px solid var(--gold);
  padding-left: 8px;
}

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 12px;
}

label span {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

label.full {
  margin-top: 8px;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

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

.btn-secondary {
  background: #5cb85c;
  border-color: #5cb85c;
  color: #fff;
}

.btn-warning {
  background: #f0ad4e;
  border-color: #f0ad4e;
  color: #fff;
}

.btn-warning:hover {
  background: #ec971f;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: center;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
}

.hint {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 12px;
}

/* 编辑表格 */
.edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}

.edit-table th,
.edit-table td {
  border: 1px solid #eee;
  padding: 6px;
  text-align: center;
}

.edit-table th {
  background: #f8f8f8;
  font-weight: 600;
}

.edit-table input {
  width: 100%;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.history-table td {
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
}

.text-center {
  text-align: center;
}

/* 登录 */
.admin-login-box {
  max-width: 360px;
  margin: 80px auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.admin-login-box h1 {
  text-align: center;
  margin: 0 0 20px;
  font-size: 22px;
  color: var(--gold-dark);
}

.login-form label {
  margin-bottom: 14px;
}

.login-form input {
  width: 100%;
}

.login-form button {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .admin-main {
    padding: 0 10px;
  }
  .edit-table {
    display: block;
    overflow-x: auto;
  }
}
