*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

a {
  color: #1a6b52;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d3b2e, #1a6b52);
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.4rem;
  color: #0d3b2e;
}

.hint {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 16px;
}

/* 后台布局 */
.admin-header {
  background: #0d3b2e;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-header .user-info {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-header a {
  color: #a8d5ba;
}

.admin-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 0.95rem;
}

.form-group input:focus {
  outline: none;
  border-color: #1a6b52;
  box-shadow: 0 0 0 2px rgba(26, 107, 82, 0.15);
}

.form-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

.form-card {
  background: #fff;
  padding: 28px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 640px;
}

.preview-img {
  max-width: 200px;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #eee;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: 0.2s;
}

.btn-primary {
  background: #1a6b52;
  color: #fff;
}

.btn-primary:hover {
  background: #0d3b2e;
  text-decoration: none;
  color: #fff;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
  text-decoration: none;
  color: #fff;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 12px;
}

/* 表格 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.data-table {
  width: 100%;
  min-width: 900px;
  background: #fff;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #555;
}

.data-table tr:hover td {
  background: #f9fffc;
}

.stat-num {
  font-weight: 600;
  color: #1a6b52;
}

.url-cell {
  font-size: 0.8rem;
  word-break: break-all;
  min-width: 140px;
}

.url-cell a {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.btn-copy {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  border: 1px solid #1a6b52;
  background: #fff;
  color: #1a6b52;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
}

.btn-copy:hover {
  background: #f0faf6;
}

.text-muted {
  color: #bbb;
}

.total-badge {
  font-size: 0.85rem;
  font-weight: normal;
  color: #888;
}

.actions {
  white-space: nowrap;
}

.actions a,
.actions form {
  display: inline-block;
  margin-right: 6px;
}

/* 提示 */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fff2f0;
  color: #cf1322;
  border: 1px solid #ffccc7;
}

.alert-success {
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
}

@media (max-width: 768px) {
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
