/* =============================================================================
   ベーススタイル
   ============================================================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

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

/* =============================================================================
   サイトヘッダー
   ============================================================================= */

.site-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.logo-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.site-nav {
    display: flex;
    gap: 4px;
}

.site-nav a {
    padding: 10px 18px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.site-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.site-nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ユーザーメニュー */
#user-menu {
    position: relative;
}

.login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.login-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.user-menu-dropdown {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: white;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: rgba(255,255,255,0.25);
}

.user-icon {
    font-size: 1.1rem;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.user-menu-content.show {
    display: block;
}

.user-menu-content .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.user-menu-content .menu-item:hover {
    background: #f1f5f9;
    color: #1e3a5f;
}

.user-menu-content .logout-btn {
    color: #ef4444;
    border-top: 1px solid #e2e8f0;
}

.user-menu-content .logout-btn:hover {
    background: #fef2f2;
}

/* =============================================================================
   広告バナー
   ============================================================================= */

.ad-banner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
}

.ad-placeholder {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.ad-header {
    margin-top: 0;
}

.ad-footer {
    margin-bottom: 0;
}

/* =============================================================================
   メインコンテンツ
   ============================================================================= */

.main-content {
    min-height: calc(100vh - 300px);
}

/* =============================================================================
   検索セクション（ヒーロー）
   ============================================================================= */

.search-section {
    text-align: center;
    padding: 48px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, white 100%);
    border-bottom: 1px solid #e2e8f0;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.search-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.search-subtitle {
    color: #64748b;
    margin-bottom: 32px;
    font-size: 1rem;
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 24px;
}

.search-box input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-box input::placeholder {
    color: #94a3b8;
}

.search-box button {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.search-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.search-box button:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 人気キーワード */
.featured-keywords {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.featured-keywords-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-keywords-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.featured-keyword-tag {
    padding: 10px 20px;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.featured-keyword-tag:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* =============================================================================
   コントロール（ソート・フィルター）
   ============================================================================= */

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.controls select {
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.controls select:focus {
    border-color: #3b82f6;
}

#result-count {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* =============================================================================
   ローディング・エラー
   ============================================================================= */

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #64748b;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

.error {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    margin-bottom: 20px;
    font-weight: 500;
}

/* =============================================================================
   検索結果カード
   ============================================================================= */

.results {
    display: grid;
    gap: 12px;
}

.product-card {
    display: grid;
    grid-template-columns: 90px auto 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.product-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.product-image-placeholder {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #94a3b8;
}

.product-image-placeholder::after {
    content: "No Image";
}

.site-badge {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border-radius: 6px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.site-badge.cardrush {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.site-badge.tierone {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.site-badge.batosuki {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.site-badge.fullahead {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.site-badge.yuyutei {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.site-badge.hobbystation {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.product-name {
    font-weight: 500;
    line-height: 1.4;
}

.product-name a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s;
}

.product-name a:hover {
    color: #3b82f6;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
}

.product-stock {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}

.product-stock.in-stock {
    background: #dcfce7;
    color: #16a34a;
}

.product-stock.out-of-stock {
    background: #fee2e2;
    color: #dc2626;
}

/* お気に入りボタン */
.favorite-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}

.favorite-btn:hover {
    color: #fbbf24;
    background: #fef3c7;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #f59e0b;
}

/* =============================================================================
   ホーム画面
   ============================================================================= */

.home-section {
    margin-top: 24px;
}

.home-stats {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.home-stats span {
    color: #64748b;
    font-size: 0.9rem;
}

.home-stats strong {
    color: #1e293b;
    font-weight: 600;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.home-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.home-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.home-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.home-item:hover {
    background: #f1f5f9;
}

.home-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
}

.home-item-name:hover {
    color: #3b82f6;
}

.home-item-price {
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
}

.home-item-shop {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: 8px;
    padding: 2px 6px;
    background: #e2e8f0;
    border-radius: 4px;
}

.home-item-diff {
    font-weight: 700;
    white-space: nowrap;
}

.home-item-diff.up {
    color: #dc2626;
}

.home-item-diff.down {
    color: #16a34a;
}

.home-item-clicks {
    color: #64748b;
    font-size: 0.8rem;
}

.home-empty {
    color: #94a3b8;
    text-align: center;
    padding: 24px;
    font-size: 0.85rem;
}

/* バッチ通知 */
.batch-notification {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.batch-notification.hidden {
    display: none;
}

.batch-notification .batch-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-notification .batch-title::before {
    content: "\2714";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 12px;
}

.batch-notification .batch-shops {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.batch-notification .batch-shop-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 14px;
}

.batch-notification .batch-shop-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.batch-notification .batch-shop-stats {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* =============================================================================
   サイトフッター
   ============================================================================= */

.site-footer {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 24px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section a,
.footer-section span {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 0;
    transition: all 0.15s ease;
}

.footer-section a:hover {
    color: white;
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #334155;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 4px 0;
}

.footer-note {
    font-size: 0.75rem !important;
    color: #475569 !important;
}

/* =============================================================================
   認証フォーム
   ============================================================================= */

.auth-container {
    max-width: 420px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    background: #f1f5f9;
    color: #475569;
}

.auth-tab.active {
    background: white;
    color: #3b82f6;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #3b82f6;
}

.auth-form {
    display: none;
    padding: 28px;
}

.auth-form.active {
    display: block;
}

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

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-error {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-error:empty {
    display: none;
}

.form-success {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #16a34a;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-success:empty {
    display: none;
}

.auth-submit {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.auth-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
}

/* =============================================================================
   管理画面
   ============================================================================= */

.admin-content {
    max-width: 900px;
    margin: 0 auto;
}

.admin-section {
    background: white;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.admin-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
}

.section-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.admin-form .form-row {
    display: flex;
    gap: 16px;
}

.admin-form .form-row .form-group {
    flex: 1;
}

.admin-btn {
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.admin-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 招待コード */
.invite-list {
    margin-top: 24px;
}

.invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.invite-item.used {
    opacity: 0.5;
}

.invite-code {
    font-family: "SF Mono", Monaco, monospace;
    font-size: 0.9rem;
    background: white;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.invite-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-used {
    color: #94a3b8;
    font-size: 0.85rem;
}

.status-unused {
    color: #16a34a;
    font-size: 0.85rem;
    font-weight: 600;
}

.copy-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    transform: translateY(-1px);
}

.invite-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.no-data {
    text-align: center;
    color: #94a3b8;
    padding: 32px;
    font-size: 0.9rem;
}

.not-admin {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.back-link {
    display: inline-block;
    margin-top: 16px;
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* キーワード管理 */
.keyword-list {
    margin-top: 24px;
}

.keyword-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.keyword-item:hover {
    background: #f1f5f9;
}

.keyword-item.inactive {
    opacity: 0.5;
}

.keyword-order {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.keyword-item.inactive .keyword-order {
    background: #94a3b8;
}

.keyword-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

.keyword-actions {
    display: flex;
    gap: 8px;
}

.keyword-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.keyword-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.keyword-btn.toggle-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    min-width: 70px;
}

.keyword-item.inactive .keyword-btn.toggle-btn {
    background: #94a3b8;
}

.keyword-btn.move-btn {
    background: #e2e8f0;
    color: #475569;
    padding: 8px 10px;
}

.keyword-btn.move-btn:hover:not(:disabled) {
    background: #cbd5e1;
}

.keyword-btn.delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.keyword-btn.delete-btn:hover {
    transform: scale(1.05);
}

.keyword-btn.update-price-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.keyword-btn.update-price-btn:hover:not(:disabled) {
    transform: scale(1.02);
}

.keyword-btn.update-price-btn:disabled {
    background: #cbd5e1;
}

/* =============================================================================
   レスポンシブ
   ============================================================================= */

@media (max-width: 768px) {
    .header-inner {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .site-logo {
        order: 1;
    }

    #user-menu {
        order: 2;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 4px;
    }

    .site-nav a {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .search-section {
        padding: 32px 16px;
    }

    .search-title {
        font-size: 1.5rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
    }

    .product-card {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }

    .product-image,
    .product-image-placeholder {
        width: 80px;
        height: 80px;
        grid-row: 1 / 4;
    }

    .controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .auth-tabs {
        flex-wrap: wrap;
    }

    .auth-tab {
        flex: 1 1 50%;
    }

    .admin-form .form-row {
        flex-direction: column;
    }

    .keyword-item {
        flex-wrap: wrap;
    }

    .keyword-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .invite-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 10px 12px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .site-nav {
        gap: 4px;
    }

    .site-nav a {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .search-title {
        font-size: 1.3rem;
    }

    .featured-keyword-tag {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .home-stats {
        flex-direction: column;
        gap: 12px;
    }
}

/* =============================================================================
   レガシー互換
   ============================================================================= */

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-link {
    color: #1e293b;
    text-decoration: none;
}

.header-link:hover {
    color: #3b82f6;
}

header h1 {
    font-size: 2rem;
    color: #1e293b;
}

.subtitle {
    color: #64748b;
    margin-top: 5px;
}
