
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

:root {
    --primary: hsl(0, 75%, 55%);
    --primary-dark: hsl(0, 75%, 45%);
    --primary-light: hsla(0, 75%, 85%, 0.3);
    --bg-page: #f8fafc;
    --card-bg: rgba(255,255,255,0.95);
    --glass-bg: rgba(255,255,255,0.7);
    --text-main: #0f172a;
    --text-light: #475569;
    --border-light: #e2e8f0;
    --shadow-sm: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
    --shadow-md: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.02);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 应用独立字体大小配置 */
    font-size: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    scroll-behavior: smooth;
}
/* ========== 统一所有输入框高度 ========== */
input, select, textarea {
    height: 2.5rem !important; /* 统一高度，与日期框保持一致 */
    line-height: 1.5;
    vertical-align: middle;
}
textarea {
    height: auto !important; /* 文本域除外 */
    min-height: 3rem;
}
/* ========== 前台样式 ========== */
.container { max-width: 1280px; margin: 0 auto; padding: 0.5rem; }
.header {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
    margin-bottom: 0.75rem;
}
.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}
.header p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.product-grid {
    display: grid;
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
}
@media (max-width: 767px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}
.product-card {
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.5s;
}
.product-card:hover img { transform: scale(1.02); }
.product-card > div { padding: 0.75rem; }
.product-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.price { color: var(--primary); font-size: 1.2rem; font-weight: 700; }
.sold { font-size: 0.75rem; color: var(--text-light); }
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}
.float-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    color: white;
    padding: 0.2rem 1rem;
    z-index: 1000;
    text-align: center;
    height: 1cm;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
}
.float-bar .row1, .float-bar .row2 { display: flex; justify-content: center; align-items: center; gap: 1rem; font-size: 0.75rem; }
.float-bar .contact-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 0;
    font-size: 0.75rem;
    cursor: pointer;
}
/* ========== 后台管理（无边框，左对齐） ========== */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg-page); }
.admin-sidebar {
    width: 240px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-light);
    padding: 1.5rem 0;
}
.sidebar-header { padding: 0 1.5rem 1rem; border-bottom: 1px solid var(--border-light); }
/* 优品后台标题可点击样式 */
.sidebar-header h3 { cursor: pointer; user-select: none; transition: color 0.2s; }
.sidebar-header h3:hover { color: var(--primary); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-item.active { background: var(--primary); color: white; border-radius: 0 1rem 1rem 0; }
.admin-content { flex: 1; padding: 1.5rem; overflow-y: auto; }
.content-panel { display: none; }
.content-panel.active-panel { display: block; }
.card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 1.5rem;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; align-items: flex-end; }
.filter-item { flex: 1; min-width: 80px; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { background: #f1f5f9; font-weight: 600; }
td { text-align: left; }
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input, textarea, select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    background: white;
    transition: 0.2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
button:hover { background: var(--primary-dark); transform: scale(0.98); }
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: white;
    width: 95%;
    height: 95%;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* 管理后台手机端自适应修复 */
@media (max-width:768px){
    .admin-layout{flex-direction:column;}
    .admin-sidebar{width:100%;padding:0.5rem 0;}
    .sidebar-nav{flex-direction:row;flex-wrap:wrap;gap:0.3rem;padding:0.5rem;}
    .nav-item{padding:0.4rem 0.6rem;border-radius:0.5rem;}
    .nav-item.active{border-radius:0.5rem;}
    .admin-content{padding:0.8rem;}
    .filter-row{gap:0.4rem;}
    .filter-item{min-width:100px;flex:100%;}
    table{font-size:0.85rem;}
    th,td{padding:0.4rem;}
    .modal-content{width:100%;height:100%;border-radius:0;}
}
