* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 登录页 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #409eff;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #66b1ff;
}

.btn-danger {
    background: #f56c6c;
}

.btn-danger:hover {
    background: #f78989;
}

.btn-success {
    background: #67c23a;
}

.btn-success:hover {
    background: #85ce61;
}

.btn-warning {
    background: #e6a23c;
}

.btn-warning:hover {
    background: #ebb563;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 200px;
    background: #304156;
    color: #fff;
}

.admin-sidebar .logo {
    padding: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    background: #2b3648;
    border-bottom: 1px solid #1f2d3d;
}

.admin-sidebar nav ul {
    list-style: none;
}

.admin-sidebar nav ul li a {
    display: block;
    padding: 14px 20px;
    color: #bfcbd9;
    text-decoration: none;
    transition: all 0.3s;
}

.admin-sidebar nav ul li a:hover,
.admin-sidebar nav ul li a.active {
    background: #409eff;
    color: #fff;
}

.admin-main {
    flex: 1;
    padding: 20px;
}

.admin-header {
    background: #fff;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 18px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background: #f9f9f9;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.badge-success {
    background: #f0f9eb;
    color: #67c23a;
}

.badge-danger {
    background: #fef0f0;
    color: #f56c6c;
}

.badge-warning {
    background: #fdf6ec;
    color: #e6a23c;
}

.badge-info {
    background: #ecf5ff;
    color: #409eff;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.alert-error {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

.alert-warning {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #faecd8;
}

.alert-info {
    background: #ecf5ff;
    color: #409eff;
    border: 1px solid #d9ecff;
}

/* 前台样式 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.product-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.product-card .price {
    font-size: 28px;
    color: #f56c6c;
    font-weight: bold;
    margin: 15px 0;
}

.product-card .stock {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}

.product-card .description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* 查询表单 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input {
    width: 200px;
}

/* 订单详情 */
.order-detail {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.order-detail .row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.order-detail .row:last-child {
    border-bottom: none;
}

.order-detail .label {
    width: 120px;
    color: #666;
    font-weight: 500;
}

.order-detail .value {
    flex: 1;
}

.cdkey-box {
    background: #fff;
    border: 2px dashed #409eff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.cdkey-box .cdkey {
    font-size: 24px;
    font-weight: bold;
    color: #409eff;
    letter-spacing: 2px;
    margin: 15px 0;
    font-family: monospace;
}
