/*
 * Dream Membership Database Version Stylesheet
 *
 * 本样式表沿用前端静态版本的现代化设计。清爽的配色和卡片布局
 * 适用于会员前台和后台管理界面。部分样式针对 PHP 动态页面
 * 进行了微调。
 */

/* 重置浏览器默认样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(120deg, #f2f7fd, #ffffff);
  color: #333;
}

header {
  width: 100%;
  text-align: center;
  padding: 1rem 0;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

header img {
  max-width: 100%;
  height: auto;
}

main {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 登录卡片容器 */
.login-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 2rem;
  width: 320px;
  max-width: 90%;
  position: relative;
}

.login-card h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #2c3e50;
}

.login-card label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.login-card input, .login-card select {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.login-card button {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.login-card button:hover {
  background: #0056b3;
}

.message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #e74c3c;
}

/* 隐藏元素用 hidden 类 */
.hidden {
  display: none !important;
}

/* 会员仪表盘样式 */
.member-dashboard {
  max-width: 900px;
  width: 100%;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-bottom: 3rem;
}

.member-dashboard h2 {
  margin-bottom: 1rem;
  font-size: 1.6rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.member-info {
  margin-bottom: 1.5rem;
}

.member-info p {
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.balance {
  font-size: 1.5rem;
  font-weight: 700;
  color: #27ae60;
  margin-top: 0.5rem;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #eaeaea;
}

th {
  background: #f7f9fc;
  font-weight: 600;
}

/* 购物轨迹样式 */
.purchase-track-row.archived {
  opacity: 0.6;
  text-decoration: line-through;
}

.purchase-track-row td {
  vertical-align: top;
}

.purchase-track-row input[type="text"] {
  width: 90%;
  padding: 0.3rem;
  margin: 0.2rem 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.purchase-track-row button {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 0.3rem;
  transition: background 0.3s;
}

.purchase-track-row button.archive {
  background: #95a5a6;
}

.purchase-track-row button:hover {
  opacity: 0.8;
}

/* 等级表样式 */
.grade-table {
  margin-top: 2rem;
}

.grade-table table {
  width: 100%;
}

.grade-table th, .grade-table td {
  padding: 0.4rem;
  font-size: 0.9rem;
}

.grade-table th {
  background: #efefef;
}

/* 管理后台样式 */
.admin-panel {
  max-width: 1000px;
  width: 100%;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-bottom: 3rem;
}

.admin-panel h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  color: #34495e;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.form-group label {
  width: 160px;
  margin-right: 0.5rem;
  font-weight: 600;
}

.form-group input, .form-group select {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input[type="date"] {
  min-width: 150px;
}

.admin-panel button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.admin-panel button:hover {
  background: #0056b3;
}

/* 退出按钮样式 */
.logout-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #c0392b;
}

/* 页脚 */
footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  padding-bottom: 2rem;
}

@media (max-width: 768px) {
  .form-group label {
    width: 100%;
    margin-bottom: 0.3rem;
  }
  .form-group input, .form-group select {
    width: 100%;
  }
}