/* ============================================================
   植杰商标报价系统 — 公共样式
   common.css — loaded before page-specific styles
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #222; min-height: 100vh; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* --- Layout --- */
.hdr { background: linear-gradient(135deg, #A21F2D 0%, #8B1A26 100%); color: #fff; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.hdr .logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.hdr .nav { display: flex; gap: 6px; flex-wrap: wrap; }
.usr { font-size: 12px; color: #666; padding: 6px 16px; background: #fff; border-bottom: 1px solid #e8eaed; display: flex; align-items: center; justify-content: space-between; }
.ft { text-align: center; font-size: 11px; color: #999; margin-top: 20px; padding: 12px; }
.empty { text-align: center; padding: 40px; color: #999; font-size: 13px; }

/* --- Cards --- */
.card { background: #fff; border-radius: 10px; padding: 20px; margin: 14px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card h2 { font-size: 15px; color: #A21F2D; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1.5px solid #f0f0f0; }

/* --- Buttons --- */
.btn { padding: 10px 28px; background: #A21F2D; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: #8B1A26; }
.btn:disabled { background: #ccc; cursor: not-allowed; }
.btn.sec { background: #f5f5f5; color: #666; }
.pbtn { padding: 6px 14px; background: #fff; color: #A21F2D; border: 1.5px solid #A21F2D; border-radius: 6px; font-size: 12px; cursor: pointer; }
.pbtn:hover { background: #fff0f0; }
.fbtn { padding: 7px 14px; background: #A21F2D; color: #fff; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 500; }
.fbtn.sec { background: #f0f0f0; color: #666; }
.cancel { padding: 8px 20px; background: #f5f5f5; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; font-size: 13px; color: #666; }
.save { padding: 8px 20px; background: #A21F2D; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.del { background: none; border: none; color: #c62828; cursor: pointer; font-size: 13px; padding: 2px 6px; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; }
th { background: #f8f8f8; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; color: #888; border-bottom: 1.5px solid #e8eaed; white-space: nowrap; }
th.active { background: #f0f0f0; color: #A21F2D; }
th:hover { background: #f0f0f0; cursor: pointer; }
td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
tr:hover { background: #fafbfc; }
.sort-arrow { font-size: 9px; margin-left: 3px; color: #bbb; }
.rt { text-align: right; }
.n { text-align: right; }

/* --- Modal --- */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1000; justify-content: center; align-items: center; }
.modal.show { display: flex; }
.mc { background: #fff; border-radius: 12px; padding: 24px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; }
.mo { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1000; justify-content: center; align-items: center; }
.mo.show { display: flex; }
.mo-in { background: #fff; border-radius: 12px; padding: 0; max-width: 800px; width: 95%; max-height: 85vh; overflow-y: auto; }
.mo-x { position: sticky; top: 0; float: right; background: #fff; border: 1px solid #ddd; border-radius: 50%; width: 28px; height: 28px; font-size: 16px; cursor: pointer; z-index: 10; }
.mo-x:hover { background: #ffebee; color: #c62828; }

/* --- Forms --- */
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld label { font-size: 11px; color: #888; font-weight: 500; }
.fld input { padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; }
.fld input:focus { border-color: #A21F2D; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 0; }
.fbar input, .fbar select { padding: 7px 10px; border: 1.5px solid #ddd; border-radius: 6px; font-size: 12px; outline: none; }
.fbar input:focus, .fbar select:focus { border-color: #A21F2D; }

/* --- Combo Box --- */
.combo-wrap { position: relative; }
.combo-drop { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: 200px; overflow-y: auto; background: #fff; border: 1px solid #d0d5dd; border-radius: 6px; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.combo-item { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.combo-item:hover { background: #f8f0f0; }
.combo-item.sel { background: #f0e0e0; font-weight: 600; }

/* --- Tags --- */
.tag { display: inline-flex; align-items: center; gap: 4px; background: #f0e0e0; color: #A21F2D; padding: 3px 8px; border-radius: 4px; font-size: 11px; margin: 2px; }
.tag .x { cursor: pointer; font-size: 13px; opacity: .6; }
.tag .x:hover { opacity: 1; }

/* --- Misc --- */
.admin-only { }
.count { font-size: 11px; color: #999; }
.meta { font-size: 11px; color: #999; }

/* --- Mobile --- */
@media (max-width: 768px) {
  .hdr { padding: 8px 12px; }
  .hdr .logo { font-size: 15px; }
  .card { margin: 8px 10px; padding: 14px; }
  .row { flex-direction: column; }
  .mo-in { width: 98%; max-height: 90vh; }
}

/* --- Mobile responsiveness --- */
@media (max-width: 768px) {
  .hdr { padding: 8px 10px; flex-wrap: wrap; }
  .hdr .nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .header-mode { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; padding: 4px 8px; }
  .mode-bar { overflow-x: auto; }
  .card { margin: 8px 10px; padding: 12px; }
  .fbar { flex-direction: column; }
  .fbar input, .fbar select { width: 100% !important; }
  table { font-size: 11px; }
  th, td { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
}
