:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --primary: #07c160;
  --primary-dark: #06ad56;
  --danger: #e54d42;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.wrap-wide {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 6px;
  font-weight: 700;
}
.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fff;
  outline: none;
  margin-bottom: 14px;
}
input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15);
}
textarea { min-height: 72px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
.btn:active { background: var(--primary-dark); }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost {
  width: auto;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.drop {
  border: 1.5px dashed #c5cad3;
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  background: #fafbfc;
  color: var(--muted);
  margin-bottom: 12px;
  cursor: pointer;
}
.drop strong { color: var(--text); display: block; margin-bottom: 4px; }
.drop input { display: none; }

.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.previews .item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
}
.previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.previews .rm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.msg {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 0.95rem;
  display: none;
}
.msg.show { display: block; }
.msg.ok { background: #e8f8ef; color: #067a3d; }
.msg.err { background: #fdecea; color: #b42318; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.stat b { font-size: 1.15rem; margin-right: 4px; }

.order {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.order-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.order-head .meta { color: var(--muted); font-size: 0.85rem; }
.order-head .nick { font-weight: 600; }
.note { color: var(--text); font-size: 0.92rem; margin: 6px 0 10px; white-space: pre-wrap; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.thumbs a {
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  position: relative;
}
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumbs .dl {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.7rem;
  text-align: center;
  padding: 3px 0;
  text-decoration: none;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

.login-card {
  max-width: 380px;
  margin: 48px auto;
}

@media (min-width: 640px) {
  .wrap { padding-top: 32px; }
}

.export-bar {
  margin-bottom: 16px;
  padding: 14px 16px;
}
.export-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.export-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.export-label-to { font-weight: 400; }
.export-label input[type="date"] {
  width: auto;
  margin: 0;
  padding: 8px 10px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.export-sep {
  color: var(--muted);
  font-size: 0.9rem;
}
.btn-export {
  width: auto;
  padding: 10px 18px;
  font-size: 0.95rem;
  border-radius: 10px;
  white-space: nowrap;
}
.export-hint {
  margin: 10px 0 0;
  display: block;
}
.export-bar .msg {
  margin: 10px 0 0;
}
@media (max-width: 560px) {
  .export-fields { align-items: stretch; }
  .btn-export { width: 100%; }
}
