/*
 * 文件位置：新财务/public/static/site.css
 * 功能说明：客户前台样式。移动优先（手机端可用是硬指标），配色为 IDC 常见的浅色专业风。
 * 说明：不使用任何 CSS 框架，减少依赖；变量集中在 :root，改主题只改这里。
 */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f7f8fa;
    --card: #ffffff;
    --danger: #dc2626;
    --success: #059669;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px;
    height: 60px; display: flex; align-items: center; gap: 24px;
}
.logo { font-size: 18px; font-weight: 700; color: var(--brand); }
.nav { display: flex; gap: 20px; flex: 1; }
.nav a { color: var(--text); font-weight: 500; }
.nav a.active { color: var(--brand); }
.header-right { display: flex; align-items: center; gap: 12px; }

/* ---------------- 布局 ---------------- */
.container { max-width: 1160px; margin: 0 auto; padding: 24px 16px 60px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ---------------- 卡片 ---------------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.card + .card { margin-top: 16px; }
.product-card { display: flex; flex-direction: column; }
.product-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.product-desc { color: var(--text-muted); font-size: 13px; min-height: 40px; }
.spec-list { list-style: none; padding: 0; margin: 12px 0; font-size: 13px; color: var(--text-muted); }
.spec-list li { display: flex; justify-content: space-between; padding: 3px 0; }
.price-row { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.price { color: var(--danger); font-weight: 700; font-size: 20px; }
.price small { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--text); cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; font-weight: 500; }
.input, select.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; background: #fff; color: var(--text);
}
.input:focus { outline: none; border-color: var(--brand); }
.form-narrow { max-width: 420px; margin: 40px auto; }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--text-muted); font-weight: 500; }

/* ---------------- 标签 ---------------- */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.tag-pending  { background: #fef3c7; color: #92400e; }
.tag-paid     { background: #d1fae5; color: #065f46; }
.tag-cancelled{ background: #f3f4f6; color: #6b7280; }
.tag-on       { background: #dbeafe; color: #1e40af; }
/* 服务实例状态（Provisioning）：pending/provisioning/active/suspended/terminated/failed */
.tag-active      { background: #d1fae5; color: #065f46; }
.tag-provisioning{ background: #fef3c7; color: #92400e; }
.tag-suspended   { background: #ffe4e6; color: #9f1239; }
.tag-terminated  { background: #f3f4f6; color: #6b7280; }
.tag-failed      { background: #fee2e2; color: #991b1b; }

/* ---------------- 提示 ---------------- */
.toast {
    position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
    background: #111827; color: #fff; padding: 10px 18px; border-radius: 6px;
    z-index: 999; max-width: 90vw;
}
.toast-error { background: var(--danger); }
.empty { text-align: center; color: var(--text-muted); padding: 48px 0; }

/* ---------------- 用户中心 ---------------- */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
    padding: 10px 16px; background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 14px; border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
