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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: url('/static/images/bg.png') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    line-height: 1.6;
}

.header {
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.95;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.company-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.registered-card {
    border: 2px solid #667eea;
    position: relative;
}

.registered-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #667eea;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.company-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.company-icon-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.company-name {
    font-weight: 600;
    color: #555;
}

.add-card {
    border: 2px dashed #667eea;
    background: #f8f9ff;
}

.add-card .company-icon {
    color: #667eea;
}

.auth-form,
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.hidden {
    display: none;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-small {
    width: auto;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary {
    position: absolute;
    right: 1rem;
    top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.45);
}

.message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    min-height: 1rem;
}

.message.success {
    background: #e6ffed;
    color: #22863a;
}

.message.error {
    background: #ffe6e6;
    color: #d73a49;
}

.back-link {
    display: block;
    text-align: center;
    color: #667eea;
    text-decoration: none;
    margin-top: 1rem;
}

.dashboard .card h2 {
    margin-bottom: 0.75rem;
    color: #667eea;
}

.dashboard .card p {
    margin-bottom: 1rem;
    color: #666;
}

.header-nav {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.2s;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.25);
}

.nav-link:hover {
    background: rgba(0,0,0,0.45);
}

.role-entry {
    margin-bottom: 2rem;
}

.role-entry h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #667eea;
}

.role-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.river-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.9rem 2rem;
    background: rgba(0,0,0,0.45);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.5);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transition: background 0.2s, transform 0.2s;
}

.river-btn:hover {
    background: rgba(0,0,0,0.65);
    transform: translateY(-2px);
}

.tier-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.tier-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    background: #fafafa;
}

.tier-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tier-price {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.vendor-list,
.request-list {
    list-style: none;
}

.vendor-list li,
.request-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.request-list li {
    flex-direction: column;
    align-items: flex-start;
}

.vendor-list li:last-child,
.request-list li:last-child {
    border-bottom: none;
}

.qr-container {
    text-align: center;
    margin-top: 1rem;
}

.qr-container img {
    max-width: 240px;
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.email-container {
    margin-top: 1rem;
}

.email-container input,
.email-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background: #f9f9f9;
}

.current-icon {
    margin-bottom: 1rem;
}

.current-icon img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.category-list {
    margin-top: 1.25rem;
}

.category-list h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.category-item {
    display: inline-block;
    background: #edf2f7;
    color: #2d3748;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    margin: 0 0.5rem 0.5rem 0;
    font-size: 0.9rem;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
    color: #2d3748;
}

.file-meta {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.25rem;
}

.btn-danger {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

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

@media (max-width: 600px) {
    .company-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .tier-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
